Skip to content

Commit 5332389

Browse files
committed
adjust test goldens
1 parent aadb204 commit 5332389

File tree

3 files changed

+36
-30
lines changed

3 files changed

+36
-30
lines changed

test/e2e/app-dir/dynamic-io-errors/dynamic-io-errors.test.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -657,13 +657,16 @@ describe('Dynamic IO Errors', () => {
657657
} else {
658658
expect(output).toMatchInlineSnapshot(`
659659
"Error: Route "/dynamic-root": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense
660-
at c (turbopack:///[project]/app/dynamic-root/indirection.tsx:9:0)
660+
at c (turbopack:///[project]/app/dynamic-root/indirection.tsx:7:41)
661661
at main (<anonymous>)
662662
at body (<anonymous>)
663663
at html (<anonymous>)
664-
7 | export function IndirectionTwo({ children }) {
664+
5 | }
665+
6 |
666+
> 7 | export function IndirectionTwo({ children }) {
667+
| ^
665668
8 | return children
666-
> 9 | }
669+
9 | }
667670
10 |
668671
To get a more detailed stack trace and pinpoint the issue, try one of the following:
669672
- Start the app in development mode by running \`next dev\`, then open "/dynamic-root" in your browser to investigate the error.
@@ -1679,14 +1682,14 @@ describe('Dynamic IO Errors', () => {
16791682
} else {
16801683
expect(output).toMatchInlineSnapshot(`
16811684
"Error: Route "/sync-attribution/guarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
1682-
at c (turbopack:///[project]/app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:9:6)
1683-
7 | return (
1684-
8 | <main>
1685-
> 9 | <h1>Sync IO Access</h1>
1686-
| ^
1687-
10 | <p suppressHydrationWarning>Current date and time: {data}</p>
1688-
11 | </main>
1689-
12 | )
1685+
at c (turbopack:///[project]/app/sync-attribution/guarded-async-unguarded-clientsync/client.tsx:5:15)
1686+
3 | export function SyncIO() {
1687+
4 | // This is a sync IO access that should not cause an error
1688+
> 5 | const data = new Date().toISOString()
1689+
| ^
1690+
6 |
1691+
7 | return (
1692+
8 | <main>
16901693
To get a more detailed stack trace and pinpoint the issue, try one of the following:
16911694
- Start the app in development mode by running \`next dev\`, then open "/sync-attribution/guarded-async-unguarded-clientsync" in your browser to investigate the error.
16921695
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.
@@ -1988,14 +1991,14 @@ describe('Dynamic IO Errors', () => {
19881991
} else {
19891992
expect(output).toMatchInlineSnapshot(`
19901993
"Error: Route "/sync-attribution/unguarded-async-unguarded-clientsync" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
1991-
at c (turbopack:///[project]/app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:9:6)
1992-
7 | return (
1993-
8 | <main>
1994-
> 9 | <h1>Sync IO Access</h1>
1995-
| ^
1996-
10 | <p suppressHydrationWarning>Current date and time: {data}</p>
1997-
11 | </main>
1998-
12 | )
1994+
at c (turbopack:///[project]/app/sync-attribution/unguarded-async-unguarded-clientsync/client.tsx:5:15)
1995+
3 | export function SyncIO() {
1996+
4 | // This is a sync IO access that should not cause an error
1997+
> 5 | const data = new Date().toISOString()
1998+
| ^
1999+
6 |
2000+
7 | return (
2001+
8 | <main>
19992002
To get a more detailed stack trace and pinpoint the issue, try one of the following:
20002003
- Start the app in development mode by running \`next dev\`, then open "/sync-attribution/unguarded-async-unguarded-clientsync" in your browser to investigate the error.
20012004
- Rerun the production build with \`next build --debug-prerender\` to generate better stack traces.

test/e2e/app-dir/server-source-maps/server-source-maps.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,15 @@ describe('app-dir - server source maps', () => {
230230
}
231231
} else {
232232
if (isTurbopack) {
233-
// TODO(veil): Sourcemapping line off
234233
// TODO(veil): Sourcemap names
235234
// TODO(veil): relative paths
236235
expect(normalizeCliOutput(next.cliOutput)).toContain(
237-
'(bundler:///app/ssr-error-log-ignore-listed/page.js:24:2)'
236+
'(bundler:///app/ssr-error-log-ignore-listed/page.js:9:16)'
238237
)
239238
expect(normalizeCliOutput(next.cliOutput)).toContain(
240-
'\n> 24 | })\n | ^'
239+
'\n' +
240+
"> 9 | const error = new Error('ssr-error-log-ignore-listed')\n" +
241+
' | ^\n'
241242
)
242243
} else {
243244
// TODO(veil): line/column numbers are flaky in Webpack

test/production/app-dir/build-output-prerender/build-output-prerender.test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('build-output-prerender', () => {
6161
} else {
6262
if (isTurbopack) {
6363
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
64-
"▲ Next.js x.y.z (Turbopack)
64+
"▲ Next.js 15.4.2-canary.1 (Turbopack)
6565
- Experiments (use with caution):
6666
✓ dynamicIO
6767
✓ enablePrerenderSourceMaps (enabled by \`experimental.dynamicIO\`)"
@@ -82,10 +82,12 @@ describe('build-output-prerender', () => {
8282
// TODO(veil): Why is the location incomplete unless we enable --no-mangling?
8383
expect(getPrerenderOutput(next.cliOutput)).toMatchInlineSnapshot(`
8484
"Error: Route "/client" used \`new Date()\` inside a Client Component without a Suspense boundary above it. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time-client
85-
at c (turbopack:///[project]/app/client/page.tsx:5:0)
85+
at c (turbopack:///[project]/app/client/page.tsx:4:27)
86+
2 |
8687
3 | export default function Page() {
87-
4 | return <p>Current time: {new Date().toISOString()}</p>
88-
> 5 | }
88+
> 4 | return <p>Current time: {new Date().toISOString()}</p>
89+
| ^
90+
5 | }
8991
6 |
9092
To get a more detailed stack trace and pinpoint the issue, try one of the following:
9193
- Start the app in development mode by running \`next dev\`, then open "/client" in your browser to investigate the error.
@@ -177,13 +179,13 @@ describe('build-output-prerender', () => {
177179
if (isTurbopack) {
178180
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
179181
"⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
180-
▲ Next.js x.y.z (Turbopack)
182+
▲ Next.js 15.4.2-canary.1 (Turbopack)
181183
- Experiments (use with caution):
182184
✓ dynamicIO
183185
⨯ turbopackMinify (disabled by \`--debug-prerender\`)
184186
✓ serverSourceMaps (enabled by \`--debug-prerender\`)
185187
⨯ prerenderEarlyExit (disabled by \`--debug-prerender\`)
186-
✓ enablePrerenderSourceMaps (enabled by \`--debug-prerender\`)"
188+
✓ enablePrerenderSourceMaps (enabled by \`experimental.dynamicIO\`)"
187189
`)
188190
} else {
189191
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
@@ -309,7 +311,7 @@ describe('build-output-prerender', () => {
309311
} else {
310312
if (isTurbopack) {
311313
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(
312-
`"▲ Next.js x.y.z (Turbopack)"`
314+
`"▲ Next.js 15.4.2-canary.1 (Turbopack)"`
313315
)
314316
} else {
315317
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(
@@ -388,7 +390,7 @@ describe('build-output-prerender', () => {
388390
if (isTurbopack) {
389391
expect(getPreambleOutput(next.cliOutput)).toMatchInlineSnapshot(`
390392
"⚠ Prerendering is running in debug mode. Note: This may affect performance and should not be used for production.
391-
▲ Next.js x.y.z (Turbopack)
393+
▲ Next.js 15.4.2-canary.1 (Turbopack)
392394
- Experiments (use with caution):
393395
⨯ turbopackMinify (disabled by \`--debug-prerender\`)
394396
✓ serverSourceMaps (enabled by \`--debug-prerender\`)

0 commit comments

Comments
 (0)