-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Labels
Description
Link to the code that reproduces this issue
https://github.com/gabezeck/next-playwright-testmode-msw
To Reproduce
- Run
npm run testfrom the root of the repo - This should run the only test file, which is here.
- This ends up triggering an error when hitting this portion of the testmode code:
const mockedRequest = new MockedRequest(new URL(request.url), {
It results in a "TypeError: _msw.MockedRequest is not a constructor" error, which occurs because MockedRequest is no longer a constructor in MSW > 2.0.
Current vs. Expected behavior
The current behavior results in the tests failing with the error outlined above. I would expect the testmode code to be updated to correctly create mocked requests based upon the current version of the package.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:59:33 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T8112
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 20.10.0
npm: 10.2.3
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.2.0-canary.23 // Latest available version is detected (14.2.0-canary.23).
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
No response
nautilytics, majakomel, tnyo43, konomae, zorro901 and 3 more