Unverified Commit 97532172 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Deflake…

[test] Deflake `test/development/app-dir/hydration-error-count/hydration-error-count.test.ts` (#88749)
parent e1685de2
...@@ -334,11 +334,11 @@ describe('hydration-error-count', () => { ...@@ -334,11 +334,11 @@ describe('hydration-error-count', () => {
it('should display runtime error separately from hydration errors', async () => { it('should display runtime error separately from hydration errors', async () => {
const browser = await next.browser('/hydration-with-runtime-errors') const browser = await next.browser('/hydration-with-runtime-errors')
if (process.env.__NEXT_CACHE_COMPONENTS) { await expect(browser).toDisplayRedbox(`
await expect(browser).toDisplayRedbox(` [
[ {
{ "componentStack": "...
"componentStack": "... <Next.js Internal Component>
<Next.js Internal Component> <Next.js Internal Component>
<Next.js Internal Component> <Next.js Internal Component>
<Next.js Internal Component> <Next.js Internal Component>
...@@ -349,55 +349,49 @@ describe('hydration-error-count', () => { ...@@ -349,55 +349,49 @@ describe('hydration-error-count', () => {
<Next.js Internal Component> <Next.js Internal Component>
<Next.js Internal Component> <Next.js Internal Component>
<Next.js Internal Component> <Next.js Internal Component>
<Next.js Internal Component> <Next.js Internal Component>
<Next.js Internal Component> <Page params={Promise} searchParams={Promise}>
<Page params={Promise} searchParams={Promise}> > <p>
> <p> > <p>
> <p>
...
... ...
...", ...
"description": "In HTML, <p> cannot be a descendant of <p>. ...",
This will cause a hydration error.", "description": "In HTML, <p> cannot be a descendant of <p>.
"environmentLabel": null, This will cause a hydration error.",
"label": "Console Error", "environmentLabel": null,
"source": "app/hydration-with-runtime-errors/page.tsx (12:14) @ Page "label": "Console Error",
> 12 | sneaky <p>very sneaky</p> "source": "app/hydration-with-runtime-errors/page.tsx (12:14) @ Page
| ^", > 12 | sneaky <p>very sneaky</p>
"stack": [ | ^",
"p <anonymous>", "stack": [
"Page app/hydration-with-runtime-errors/page.tsx (12:14)", "p <anonymous>",
], "Page app/hydration-with-runtime-errors/page.tsx (12:14)",
}, ],
{ },
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:", {
"environmentLabel": null, "description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
"label": "Recoverable Error", "environmentLabel": null,
"source": "app/hydration-with-runtime-errors/page.tsx (12:14) @ Page "label": "Recoverable Error",
> 12 | sneaky <p>very sneaky</p> "source": "app/hydration-with-runtime-errors/page.tsx (12:14) @ Page
| ^", > 12 | sneaky <p>very sneaky</p>
"stack": [ | ^",
"p <anonymous>", "stack": [
"Page app/hydration-with-runtime-errors/page.tsx (12:14)", "p <anonymous>",
], "Page app/hydration-with-runtime-errors/page.tsx (12:14)",
}, ],
{ },
"description": "runtime error", {
"environmentLabel": null, "description": "runtime error",
"label": "Runtime Error", "environmentLabel": null,
"source": "app/hydration-with-runtime-errors/page.tsx (7:11) @ Page.useEffect "label": "Runtime Error",
> 7 | throw new Error('runtime error') "source": "app/hydration-with-runtime-errors/page.tsx (7:11) @ Page.useEffect
| ^", > 7 | throw new Error('runtime error')
"stack": [ | ^",
"Page.useEffect app/hydration-with-runtime-errors/page.tsx (7:11)", "stack": [
], "Page.useEffect app/hydration-with-runtime-errors/page.tsx (7:11)",
}, ],
] },
`) ]
} else { `)
await expect(browser).toDisplayCollapsedRedbox(
`"Redbox is already open. Use \`toDisplayRedbox\` instead."`
)
}
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment