Open patrickberkeley opened 4 years ago
Great use cases - these have definitely been brought up before and I think the solution here is to add a middleware layer to Mirage that makes this sort of thing easy.
I am nearly done with the Mirage tutorial, after which our priorities are
At the top of prioritized feature work is middleware, and improving passthrough
. But I'm glad you opened this because it's good to hear from folks who could benefit from a middleware system. I think it's definitely miragejs/ember-cli-mirage#1 or miragejs/ember-cli-mirage#2 in terms of priority.
(Heya Patrick! 👋 Hope you are doing well)
Thanks for the info, Sam! Hope you are doing well too! 👋 Please feel free to close this issue if you'd like.
Transferred it over to our /discuss repo since it's not actionable ATM but thanks again for dropping these ideas in! 👍
A lot of API docs include sample responses for each endpoint e.g., see THE CHARGE OBJECT on https://stripe.com/docs/api/charges/object.
Currently with Mirage when tests are run you can easily add a logger to each endpoint defined in
mirage/config.js
e.g.,console.log(this.serialize(books.all()));
.This issue is a feature request to add the ability to mirage to automatically generate a JSON structure with all the request objects from the endpoints that were hit in each test run. The idea being the JSON could be used: