Replies: 2 comments 1 reply
-
Hey there, @GazEdge! I'm a bot designed to help you out with bugs, questions, and becoming a contributor. Feel free to ask me anything while waiting for a human maintainer to assist you. To mock the responses from external APIs for end-to-end (E2E) testing in a Nuxt application, you can use the
By using For more detailed information on setting up and using |
Beta Was this translation helpful? Give feedback.
-
@dosu your answer wont work, as registerEndpoint can only be used in runtime testing. Find a solution that works with @nuxt/test-utils/e2e |
Beta Was this translation helpful? Give feedback.
-
Im using e2e testing, but rather than use /server/api for my endpoints (called client side only), I use external apis.
How can i mock the responses from external apis?
Ive tried a few 3rd party tools, like miragejs, but im guessing its not being pulled into the nuxt test instance.
Does anyone have a solution to this? I know i could probably use runtime and component testing to apply mocks to the api calls, but I'd prefer to run tests e2e, but with mocked external apis.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions