You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My controllers are using a service provider that uses a REST datasource. This pulls in data from a remote server and then the controller manipulates this data to send to the client. I'm trying to find the best way to mock the responses from the remotes service in order to test the controller.
If your goal is to test controllers in isolation and use a mocked service instance, then I would recommend to use https://sinonjs.org and stub the service the same way as you are stubbing repositories.
My controllers are using a service provider that uses a REST datasource. This pulls in data from a remote server and then the controller manipulates this data to send to the client. I'm trying to find the best way to mock the responses from the remotes service in order to test the controller.
The documentation has a section for stub services but it is not currently populated.
https://loopback.io/doc/en/lb4/Testing-your-application.html#create-a-stub-service
Can you please point me in the right direction.
The text was updated successfully, but these errors were encountered: