Skip to content

Commit

Permalink
test(snapshot): update snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Mar 11, 2024
1 parent b201ecc commit 60bec33
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions test/development/acceptance-app/invalid-imports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,26 @@ describe('Error Overlay invalid imports', () => {
await session.patch(pageFile, withoutUseClient)

expect(await session.hasRedbox()).toBe(true)
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"./app/comp2.js
'client-only' cannot be imported from a Server Component module. It should only be used from a Client Component.
if (process.env.TURBOPACK) {
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"./app
Invalid import
'client-only' cannot be imported from a Server Component module. It should only be used from a Client Component.
The error was caused by using 'styled-jsx'. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default."
`)
} else {
expect(await session.getRedboxSource()).toMatchInlineSnapshot(`
"./app/comp2.js
'client-only' cannot be imported from a Server Component module. It should only be used from a Client Component.
The error was caused by using 'styled-jsx' in './app/comp2.js'. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
The error was caused by using 'styled-jsx' in './app/comp2.js'. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
Import trace for requested module:
./app/comp2.js
./app/comp1.js
./app/page.js"
`)
Import trace for requested module:
./app/comp2.js
./app/comp1.js
./app/page.js"
`)
}

await cleanup()
})
Expand Down

0 comments on commit 60bec33

Please sign in to comment.