Skip to content

Commit bbf5426

Browse files
authored
[test] consolidate hmr test for react 18.3 (#76975)
Update flaky 18.3 test x-ref: https://github.com/vercel/next.js/actions/runs/13770136279/job/38509693811
1 parent 8331b8c commit bbf5426

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

test/development/acceptance/ReactRefreshLogBox.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import { createSandbox } from 'development-sandbox'
33
import { FileRef, nextTestSetup } from 'e2e-utils'
44
import {
5+
getRedboxTotalErrorCount,
56
getStackFramesContent,
7+
retry,
68
toggleCollapseCallStackFrames,
79
} from 'next-test-utils'
810
import path from 'path'
@@ -1103,8 +1105,11 @@ describe('ReactRefreshLogBox', () => {
11031105
const { browser } = sandbox
11041106

11051107
if (isReact18) {
1106-
// TODO(veil): Why different error count between Turbopack and Webpack?
11071108
if (isTurbopack) {
1109+
// Wait for the error to reach the correct count
1110+
await retry(async () => {
1111+
expect(await getRedboxTotalErrorCount(browser)).toBe(3)
1112+
})
11081113
await expect(browser).toDisplayRedbox(`
11091114
{
11101115
"count": 3,
@@ -1120,9 +1125,13 @@ describe('ReactRefreshLogBox', () => {
11201125
}
11211126
`)
11221127
} else {
1128+
// Wait for the error to reach the correct count
1129+
await retry(async () => {
1130+
expect(await getRedboxTotalErrorCount(browser)).toBe(3)
1131+
})
11231132
await expect(browser).toDisplayRedbox(`
11241133
{
1125-
"count": 2,
1134+
"count": 3,
11261135
"description": "Error: Client error",
11271136
"environmentLabel": null,
11281137
"label": "Unhandled Runtime Error",

0 commit comments

Comments
 (0)