Skip to content

Commit

Permalink
Skip failing stack frames test (#71325)
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable authored Oct 15, 2024
1 parent fc6958f commit 51e1a24
Showing 1 changed file with 31 additions and 25 deletions.
56 changes: 31 additions & 25 deletions test/development/acceptance-app/ReactRefreshLogBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1209,35 +1209,40 @@ export default function Home() {
await cleanup()
})

test('Should collapse bundler internal stack frames', async () => {
const { session, browser, cleanup } = await sandbox(
next,
new Map([
[
'app/utils.ts',
`throw new Error('utils error')
// TODO: Fails with Webpack since
// https://github.com/vercel/next.js/pull/71312, not reproducible locally,
// investigate why.
;(isTurbopack ? test : test.skip)(
'Should collapse bundler internal stack frames',
async () => {
const { session, browser, cleanup } = await sandbox(
next,
new Map([
[
'app/utils.ts',
`throw new Error('utils error')
export function foo(){}`,
],
[
'app/page.js',
`"use client";
],
[
'app/page.js',
`"use client";
import { foo } from "./utils";
export default function Home() {
foo();
return "hello";
}`,
],
])
)
],
])
)

await session.assertHasRedbox()
await session.assertHasRedbox()

let stack = next.normalizeTestDirContent(
await getRedboxCallStackCollapsed(browser)
)
if (isTurbopack) {
expect(stack).toMatchInlineSnapshot(`
let stack = next.normalizeTestDirContent(
await getRedboxCallStackCollapsed(browser)
)
if (isTurbopack) {
expect(stack).toMatchInlineSnapshot(`
"app/utils.ts (1:7) @ [project]/app/utils.ts [app-client] (ecmascript)
---
Next.js
Expand All @@ -1249,8 +1254,8 @@ export default function Home() {
---
React"
`)
} else {
expect(stack).toMatchInlineSnapshot(`
} else {
expect(stack).toMatchInlineSnapshot(`
"app/utils.ts (1:7) @ eval
---
(app-pages-browser)/./app/utils.ts
Expand All @@ -1268,8 +1273,9 @@ export default function Home() {
---
React"
`)
}
}

await cleanup()
})
await cleanup()
}
)
})

0 comments on commit 51e1a24

Please sign in to comment.