Skip to content

Commit

Permalink
Updates tests due to unflagged sync stack traces
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Oct 16, 2024
1 parent 929b6d8 commit 5fafe44
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
38 changes: 36 additions & 2 deletions test/development/acceptance-app/ReactRefreshLogBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,17 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
const stackFrames = await Promise.all(
stackFrameElements.map((f) => f.innerText())
)
expect(stackFrames).toEqual([])
expect(stackFrames).toEqual(
// TODO: Show useful stack
[
// Internal frames of React.
// Feel free to adjust until we show useful stacks.
'',
'',
'',
'',
]
)
} finally {
await cleanup()
}
Expand Down Expand Up @@ -909,12 +919,26 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
Page
app/page.js (5:6)
`,
// TODO: Show useful stack
// Internal frames of React.
// Feel free to adjust until we show useful stacks.
'',
'',
'',
'',
]
: [
outdent`
Page
app/page.js (5:5)
`,
// TODO: Show useful stack
// Internal frames of React.
// Feel free to adjust until we show useful stacks.
'',
'',
'',
'',
]
)
} finally {
Expand Down Expand Up @@ -957,7 +981,17 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox app %s', () => {
const stackFrames = await Promise.all(
stackFrameElements.map((f) => f.innerText())
)
expect(stackFrames).toEqual([])
expect(stackFrames).toEqual(
// TODO: Show useful stack
[
// Internal frames of React.
// Feel free to adjust until we show useful stacks.
'',
'',
'',
'',
]
)
} finally {
await cleanup()
}
Expand Down
20 changes: 8 additions & 12 deletions test/development/app-dir/dynamic-error-trace/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
} from 'next-test-utils'
import { outdent } from 'outdent'

const isReactExperimental = process.env.__NEXT_EXPERIMENTAL_PPR === 'true'

describe('app dir - dynamic error trace', () => {
const { next, skipped } = nextTestSetup({
files: __dirname,
Expand Down Expand Up @@ -48,16 +46,14 @@ describe('app dir - dynamic error trace', () => {
)
expect(stackFrames).toEqual(
// TODO: Show useful stack
isReactExperimental
? [
// Internal frames of React.
// Feel free to adjust until we show useful stacks.
'',
'',
'',
'',
]
: []
[
// Internal frames of React.
// Feel free to adjust until we show useful stacks.
'',
'',
'',
'',
]
)

const codeframe = await getRedboxSource(browser)
Expand Down

0 comments on commit 5fafe44

Please sign in to comment.