Skip to content

Commit

Permalink
Update jest snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 12, 2024
1 parent a19f282 commit daaf8b6
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions test/development/acceptance-app/rsc-build-errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ describe('Error overlay - RSC build errors', () => {
expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(`
"./app/server-with-errors/error-file/error.js
Error: x TEST_DIR/app/server-with-errors/error-file/error.js must be a Client
Error: ! Plugin is not supported with current @swc/core. Plugin transform will be skipped.
x TEST_DIR/app/server-with-errors/error-file/error.js must be a Client
| Component. Add the "use client" directive the top of the file to resolve this issue.
| Learn more: https://nextjs.org/docs/getting-started/react-essentials#client-components
|
Expand Down Expand Up @@ -377,24 +378,26 @@ describe('Error overlay - RSC build errors', () => {
await session.patch('app/server-with-errors/error-file/error.js', '')

await session.assertHasRedbox()
await check(() => session.getRedboxSource(), /must be a Client Component/)

// TODO: investigate flakey snapshot due to spacing below
// expect(next.normalizeTestDirContent(await session.getRedboxSource()))
// .toMatchInlineSnapshot(n`
// "./app/server-with-errors/error-file/error.js
// ReactServerComponentsError:

// ./app/server-with-errors/error-file/error.js must be a Client Component. Add the "use client" directive the top of the file to resolve this issue.

// ,-[TEST_DIR/app/server-with-errors/error-file/error.js:1:1]
// 1 |
// : ^
// \`----

// Import path:
// ./app/server-with-errors/error-file/error.js"
// `)
// TODO: This check is disabled because line break make this check fail
// await check(() => session.getRedboxSource(), /must be a Client Component/)

expect(next.normalizeTestDirContent(await session.getRedboxSource()))
.toMatchInlineSnapshot(`
"./app/server-with-errors/error-file/error.js
Error: ! Plugin is not supported with current @swc/core. Plugin transform will be skipped.
x TEST_DIR/app/server-with-errors/error-file/error.js must be a Client
| Component. Add the "use client" directive the top of the file to resolve this issue.
| Learn more: https://nextjs.org/docs/getting-started/react-essentials#client-components
|
|
,----
1 |
: ^
\`----
Import trace for requested module:
./app/server-with-errors/error-file/error.js"
`)

await cleanup()
})
Expand Down

0 comments on commit daaf8b6

Please sign in to comment.