Commit a1d98a72 authored by devjiwonchoi's avatar devjiwonchoi

Update test to be Cache Components compatible

parent 24b79b2b
export const revalidate = 0 import { Suspense } from 'react'
import { connection } from 'next/server'
export default function Page() {
return (
<Suspense>
<PageImpl />
</Suspense>
)
}
let hasThrown = false let hasThrown = false
export default function Page() { async function PageImpl() {
// Throw only during the runtime
await connection()
if (!hasThrown) { if (!hasThrown) {
hasThrown = true hasThrown = true
throw new Error('this is a test') throw new Error('this is a test')
......
...@@ -267,55 +267,55 @@ describe('app-dir - errors', () => { ...@@ -267,55 +267,55 @@ describe('app-dir - errors', () => {
await browser.elementByCss('#error-component-stack').text() await browser.elementByCss('#error-component-stack').text()
) )
).toMatchInlineSnapshot(` ).toMatchInlineSnapshot(`
[ [
"at Page", "at Page",
"at ClientPageRoot", "at ClientPageRoot",
"at SegmentViewNode", "at SegmentViewNode",
"at InnerLayoutRouter", "at InnerLayoutRouter",
"at RedirectErrorBoundary", "at RedirectErrorBoundary",
"at RedirectBoundary", "at RedirectBoundary",
"at HTTPAccessFallbackBoundary", "at HTTPAccessFallbackBoundary",
"at LoadingBoundary", "at LoadingBoundary",
"at ErrorBoundaryHandler", "at ErrorBoundaryHandler",
"at ErrorBoundary", "at ErrorBoundary",
"at InnerScrollAndFocusHandler", "at InnerScrollAndFocusHandlerOld",
"at ScrollAndFocusHandler", "at ScrollAndFocusHandler",
"at RenderFromTemplateContext", "at RenderFromTemplateContext",
"at SegmentStateProvider", "at SegmentStateProvider",
"at OuterLayoutRouter", "at OuterLayoutRouter",
"at InnerLayoutRouter", "at InnerLayoutRouter",
"at RedirectErrorBoundary", "at RedirectErrorBoundary",
"at RedirectBoundary", "at RedirectBoundary",
"at HTTPAccessFallbackErrorBoundary", "at HTTPAccessFallbackErrorBoundary",
"at HTTPAccessFallbackBoundary", "at HTTPAccessFallbackBoundary",
"at LoadingBoundary", "at LoadingBoundary",
"at ErrorBoundary", "at ErrorBoundary",
"at InnerScrollAndFocusHandler", "at InnerScrollAndFocusHandlerOld",
"at ScrollAndFocusHandler", "at ScrollAndFocusHandler",
"at RenderFromTemplateContext", "at RenderFromTemplateContext",
"at SegmentStateProvider", "at SegmentStateProvider",
"at OuterLayoutRouter", "at OuterLayoutRouter",
"at body", "at body",
"at html", "at html",
"at RootLayout [Server]", "at RootLayout [Server]",
"at SegmentViewNode", "at SegmentViewNode",
"at __next_root_layout_boundary__", "at __next_root_layout_boundary__",
"at RedirectErrorBoundary", "at RedirectErrorBoundary",
"at RedirectBoundary", "at RedirectBoundary",
"at HTTPAccessFallbackErrorBoundary", "at HTTPAccessFallbackErrorBoundary",
"at HTTPAccessFallbackBoundary", "at HTTPAccessFallbackBoundary",
"at DevRootHTTPAccessFallbackBoundary", "at DevRootHTTPAccessFallbackBoundary",
"at AppDevOverlayErrorBoundary", "at AppDevOverlayErrorBoundary",
"at HotReload", "at HotReload",
"at Router", "at Router",
"at ErrorBoundaryHandler", "at ErrorBoundaryHandler",
"at ErrorBoundary", "at ErrorBoundary",
"at RootErrorBoundary", "at RootErrorBoundary",
"at AppRouter", "at AppRouter",
"at ServerRoot", "at ServerRoot",
"at Root", "at Root",
] ]
`) `)
expect( expect(
normalizeComponentStack( normalizeComponentStack(
......
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