File tree Expand file tree Collapse file tree
test/development/acceptance Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import { createSandbox } from 'development-sandbox'
33import { FileRef , nextTestSetup } from 'e2e-utils'
44import {
5+ getRedboxTotalErrorCount ,
56 getStackFramesContent ,
7+ retry ,
68 toggleCollapseCallStackFrames ,
79} from 'next-test-utils'
810import 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",
You can’t perform that action at this time.
0 commit comments