New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use with msw
to mock requests
#775
Labels
Comments
8 tasks
Linking unjs/ofetch#295 here as well |
As a workaround you can try to use |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Reproduction
https://stackblitz.com/~/github.com/rinux55/nuxt-fetch
See
app.test.ts
. In thetest/setup.ts
andtest/server.ts
there is anmsw
server being set up with a mocked endpoint.Describe the bug
To mock requests made using
$fetch
anduseFetch
, I expect to be able to use a utility likemsw
.Unfortunately, this doesn't seem to work in combination with
@nuxt/test-utils
.I've created a reproduction where you can see that
globalThis.fetch
is mocked just fine, butuseFetch
orfetch
is not:https://stackblitz.com/~/github.com/rinux55/nuxt-fetch
Any help with this would be greatly appreciated.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: