Skip to content
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

Use msw instead of fetch-mock to test fetch in browser #6

Open
trivikr opened this issue May 19, 2023 · 0 comments
Open

Use msw instead of fetch-mock to test fetch in browser #6

trivikr opened this issue May 19, 2023 · 0 comments

Comments

@trivikr
Copy link
Owner

trivikr commented May 19, 2023

Is your feature request related to a problem? Please describe.
The issue which returns null response body for null body status is not reproducible with fetch-mock in #5

It's likely because fetch-mock doesn't create actual fetch call to a local server, and mocks fetch behavior.
Docs: https://www.wheresrhys.co.uk/fetch-mock/

Describe the solution you'd like
Use mock service worker to create a server to which fetch call can be made to https://www.npmjs.com/package/msw
The previous attempt was made in #1

Describe alternatives you've considered
N/A

@trivikr trivikr changed the title Use msw instead of fetch-mock to mock fetch Use msw instead of fetch-mock to test fetch in browser May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant