vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.28k stars 27.02k forks source link

Address fetch restoration in dev mode that overrides test-side patching #53407

Closed dvoytenko closed 10 months ago

dvoytenko commented 1 year ago

Verify canary release

Provide environment information

Any

Which area(s) of Next.js are affected? (leave empty if unsure)

App Router

Link to the code that reproduces this issue or a replay of the bug

https://github.com/mswjs/msw/issues/1644

To Reproduce

https://github.com/mswjs/msw/issues/1644

Describe the Bug

The next-dev-server restores the fetch to the original implementation here. This affects tools, such as MSW, that need to be able to patch fetch to mock the API for tests. See https://github.com/mswjs/msw/issues/1644 for more details.

Expected Behavior

The next dev fetch behavior doesn't interfere with tests.

Which browser are you using? (if relevant)

n/a

How are you deploying your application? (if relevant)

n/a

github-actions[bot] commented 9 months ago

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.