diff --git a/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts b/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts index bdc4dcfe0849b..8f48695a3bbab 100644 --- a/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts +++ b/test/development/app-dir/dynamic-io-dev-errors/dynamic-io-dev-errors.test.ts @@ -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] - (2:1) - Root [Server] - (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(' (2:1)') }) })