Re:MirageJS: An API mocking library for frontend development
by acemarke on Friday January 24, 2020 @04:19PM
(#22142568)
From reading the docs and the source, it's not a proxy. It looks like it uses https://github.com/pretenderjs/pretender , which overwrites the original `XmlHttpRequest` and `fetch` functions in the browser to intercept any attempts to make AJAX requests. It then makes your attempted request with its own internal routing definitions, and returns the responses you defined.
Re:MirageJS: An API mocking library for frontend development
by duxup on Friday January 24, 2020 @04:36PM
(#22142712)
Ah thank you!
Re:MirageJS: An API mocking library for frontend development
by lukenyc on Saturday January 25, 2020 @10:02AM
(#22146488)
We use mirage with test-controlled response timings to be able to acceptance test loading states. Works great.
You can also configure a universal delay if you’re using mirage in development and want to get a feel for your app with a certain amount of latency.
So you install it as a dev dependency via npm.
So is it running ... with the client app as a proxy between the client application and just waiting for the API requests and taking those responding?
Is it possible to configure some delay in responses?