next.js
next.js copied to clipboard
Update documentation for experimental Playwright test mode + msw v2
Next.js 15 updated msw from 1.3.0 to 2.3.0 (https://github.com/vercel/next.js/pull/66351), this PR updates the example in the experimental Playwright test mode documentation to reflect this.
Additionally:
- Added catch-all passthrough route to example.
- Fixed issue in the example with how
mswHandlerswas used (https://playwright.dev/docs/test-fixtures#fixtures-options)
Relevant discussions:
https://github.com/vercel/next.js/issues/71832
https://github.com/vercel/next.js/discussions/71330
Allow CI Workflow Run
- [ ] approve CI run for commit: 19a9a70b7b92fee93719b9cf88654e8265f8afe0
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer
Failing test suites
Commit: 5da6a6e19d418494aa81c2da4ea271c1492accf1
pnpm test-dev-turbo test/development/app-hmr/hmr.test.ts (turbopack)
- app-dir-hmr > filesystem changes > should update server components pages when env files is changed (node)
Expand output
● app-dir-hmr › filesystem changes › should update server components pages when env files is changed (node)
expect(received).toBe(expected) // Object.is equality
Expected: "mac"
Received: "ipad"
145 | async (page) => {
146 | const browser = await next.browser(`/env/${page}`)
> 147 | expect(await browser.elementByCss('p').text()).toBe('mac')
| ^
148 | await next.patchFile(envFile, 'MY_DEVICE="ipad"')
149 |
150 | const logs = await browser.log()
at toBe (development/app-hmr/hmr.test.ts:147:56)
Read more about building and testing Next.js in contributing.md.