Unverified Commit 899c416a authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

test: re-enable test with note (#71789)

parent dc1901a2
......@@ -45,8 +45,8 @@ describe('Dynamic IO Dev Errors', () => {
})
})
// Disabling so I can land docs update. reenable after
it.skip('should display error when component accessed data without suspense boundary', async () => {
// NOTE: when update this snapshot, use `pnpm build` in packages/next to avoid next source code get mapped to source.
it('should display error when component accessed data without suspense boundary', async () => {
const browser = await next.browser('/no-accessed-data')
await retry(async () => {
......@@ -57,39 +57,14 @@ describe('Dynamic IO Dev Errors', () => {
const description = await getRedboxDescription(browser)
const stack = await getRedboxCallStack(browser)
const result = {
description,
stack,
}
expect(result).toMatchInlineSnapshot(`
{
"description": "[ Server ] Error: Route "/no-accessed-data": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense",
"stack": "Page [Server]
<anonymous> (2:1)
Root [Server]
<anonymous> (2:1)
RedirectErrorBoundary
./dist/esm/server/route-modules/app-page/module.js
RedirectBoundary
./dist/esm/server/route-modules/app-page/module.js
ReactDevOverlay
./dist/esm/client/components/react-dev-overlay/app/hot-reloader-client.js
HotReload
./dist/esm/client/components/react-dev-overlay/app/hot-reloader-client.js
Router
./dist/esm/server/route-modules/app-page/module.js
ErrorBoundaryHandler
./dist/esm/server/route-modules/app-page/module.js
ErrorBoundary
./dist/esm/server/route-modules/app-page/module.js
AppRouter
./dist/esm/server/route-modules/app-page/module.js
ServerInsertedHTMLProvider
./dist/esm/server/route-modules/app-page/module.js
App
./dist/esm/server/route-modules/app-page/module.js",
}
`)
expect(description).toMatchInlineSnapshot(
`"[ Server ] Error: Route "/no-accessed-data": A component accessed data, headers, params, searchParams, or a short-lived cache without a Suspense boundary nor a "use cache" above it. We don't have the exact line number added to error messages yet but you can see which component in the stack below. See more info: https://nextjs.org/docs/messages/next-prerender-missing-suspense"`
)
// TODO: use snapshot testing for stack
// FIXME: avoid `next` code to be mapped to source code and filter them out even when sourcemap is enabled.
expect(stack).toContain('Page [Server]')
expect(stack).toContain('Root [Server]')
expect(stack).toContain('<anonymous> (2:1)')
})
})
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