Unverified Commit 51e1a249 authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub
parent fc6958fe
...@@ -1209,35 +1209,40 @@ export default function Home() { ...@@ -1209,35 +1209,40 @@ export default function Home() {
await cleanup() await cleanup()
}) })
test('Should collapse bundler internal stack frames', async () => { // TODO: Fails with Webpack since
const { session, browser, cleanup } = await sandbox( // https://github.com/vercel/next.js/pull/71312, not reproducible locally,
next, // investigate why.
new Map([ ;(isTurbopack ? test : test.skip)(
[ 'Should collapse bundler internal stack frames',
'app/utils.ts', async () => {
`throw new Error('utils error') const { session, browser, cleanup } = await sandbox(
next,
new Map([
[
'app/utils.ts',
`throw new Error('utils error')
export function foo(){}`, export function foo(){}`,
], ],
[ [
'app/page.js', 'app/page.js',
`"use client"; `"use client";
import { foo } from "./utils"; import { foo } from "./utils";
export default function Home() { export default function Home() {
foo(); foo();
return "hello"; return "hello";
}`, }`,
], ],
]) ])
) )
await session.assertHasRedbox() await session.assertHasRedbox()
let stack = next.normalizeTestDirContent( let stack = next.normalizeTestDirContent(
await getRedboxCallStackCollapsed(browser) await getRedboxCallStackCollapsed(browser)
) )
if (isTurbopack) { if (isTurbopack) {
expect(stack).toMatchInlineSnapshot(` expect(stack).toMatchInlineSnapshot(`
"app/utils.ts (1:7) @ [project]/app/utils.ts [app-client] (ecmascript) "app/utils.ts (1:7) @ [project]/app/utils.ts [app-client] (ecmascript)
--- ---
Next.js Next.js
...@@ -1249,8 +1254,8 @@ export default function Home() { ...@@ -1249,8 +1254,8 @@ export default function Home() {
--- ---
React" React"
`) `)
} else { } else {
expect(stack).toMatchInlineSnapshot(` expect(stack).toMatchInlineSnapshot(`
"app/utils.ts (1:7) @ eval "app/utils.ts (1:7) @ eval
--- ---
(app-pages-browser)/./app/utils.ts (app-pages-browser)/./app/utils.ts
...@@ -1268,8 +1273,9 @@ export default function Home() { ...@@ -1268,8 +1273,9 @@ export default function Home() {
--- ---
React" React"
`) `)
} }
await cleanup() await cleanup()
}) }
)
}) })
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