next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Update documentation for experimental Playwright test mode + msw v2

Open ariawisp opened this issue 1 year ago • 1 comments

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 mswHandlers was 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

ariawisp avatar Oct 25 '24 04:10 ariawisp

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

ijjk avatar Oct 25 '24 04:10 ijjk

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.

ijjk avatar Oct 29 '24 19:10 ijjk