diff --git a/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap b/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap index 729a695b8ed299..94114306d21425 100644 --- a/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap +++ b/test/development/acceptance/__snapshots__/error-recovery.test.ts.snap @@ -1,18 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`ReactRefreshLogBox default syntax > runtime error 1`] = ` -"index.js (5:9) @ eval - - 3 | setInterval(() => { - 4 | i++ -> 5 | throw Error('no ' + i) - | ^ - 6 | }, 1000) - 7 | export default function FunctionNamed() { - 8 | return
" -`; - -exports[`ReactRefreshLogBox turbo syntax > runtime error 1`] = ` +exports[`ReactRefreshLogBox turbo syntax > runtime error: isWin32-false--isRspack-false 1`] = ` "index.js (5:9) @ eval 3 | setInterval(() => { diff --git a/test/development/acceptance/error-recovery.test.ts b/test/development/acceptance/error-recovery.test.ts index 54c9808b625db1..879d74d8a81222 100644 --- a/test/development/acceptance/error-recovery.test.ts +++ b/test/development/acceptance/error-recovery.test.ts @@ -409,11 +409,9 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { await new Promise((resolve) => setTimeout(resolve, 1000)) await session.assertHasRedbox() - if (process.platform === 'win32') { - expect(await session.getRedboxSource()).toMatchSnapshot() - } else { - expect(await session.getRedboxSource()).toMatchSnapshot() - } + expect(await session.getRedboxSource()).toMatchSnapshot( + `isWin32-${process.platform === 'win32'}--isRspack-${Boolean(process.env.NEXT_RSPACK)}` + ) // Make a syntax error. await session.patch( @@ -446,6 +444,27 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { Expected '}', got ''" `) + } else if (process.env.NEXT_RSPACK) { + expect(redboxSource).toMatchInlineSnapshot(` + "./index.js + × Module build failed: + ├─▶ × + │ │ x Expected '}', got '' + │ │ ,-[TEST_DIR/index.js:7:1] + │ │ 4 | i++ + │ │ 5 | throw Error('no ' + i) + │ │ 6 | }, 1000) + │ │ 7 | export default function FunctionNamed() { + │ │ : ^ + │ │ \`---- + │ │ + │ + ╰─▶ Syntax Error + + Import trace for requested module: + ./index.js + ./pages/index.js" + `) } else { expect(redboxSource).toMatchInlineSnapshot(` "./index.js @@ -483,6 +502,27 @@ describe.each(['default', 'turbo'])('ReactRefreshLogBox %s', () => { Expected '}', got ''" `) + } else if (process.env.NEXT_RSPACK) { + expect(redboxSource).toMatchInlineSnapshot(` + "./index.js + × Module build failed: + ├─▶ × + │ │ x Expected '}', got '' + │ │ ,-[TEST_DIR/index.js:7:1] + │ │ 4 | i++ + │ │ 5 | throw Error('no ' + i) + │ │ 6 | }, 1000) + │ │ 7 | export default function FunctionNamed() { + │ │ : ^ + │ │ \`---- + │ │ + │ + ╰─▶ Syntax Error + + Import trace for requested module: + ./index.js + ./pages/index.js" + `) } else { expect(redboxSource).toMatchInlineSnapshot(` "./index.js