I would be interesting to be able to return fixed responses for each endpoint when a particular parameter is given (e.g. dummy = true).
This would be a very powerful feature for developing backend platforms (or API's in general) while the mobile/web cliente is being developed in parallel. So, instead of hitting the platform directly, you can provide this mock or dummy services rapidly.
Currently, the scaffolding allows to have the endpoints working quickly, however during development the inner logic experiment changes that affect the ongoing development of the client. Moreover, if you need your own remote methods then you have to write the logic before it can respond something acceptable.
I have currently a middleware that verifies for the parameter in the request and if presents modifies the request URL to a fixed /dummy passing the original URL and method as parameter. This /dummy endpoint returns an specific json depending on the original URL. Does not seem too elegant though.
I have the same request since I need to test some endpoints but I want to use DI (dependency Injection) to mock up services , is there a way to do it I see here: https://strongloop.com/strongblog/javascript-unit-testing-using-dependency-injection/ that you are using rewired , but not sure how to use into the models when the test it testing the remote method directly , any help is appreciated.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.
Most helpful comment
I have the same request since I need to test some endpoints but I want to use DI (dependency Injection) to mock up services , is there a way to do it I see here: https://strongloop.com/strongblog/javascript-unit-testing-using-dependency-injection/ that you are using rewired , but not sure how to use into the models when the test it testing the remote method directly , any help is appreciated.