Unverified Commit 05f4b877 authored by Sebastian "Sebbie" Silbermann's avatar Sebastian "Sebbie" Silbermann Committed by GitHub

[test] Use new Redbox matchers in pages/ error-recovery test (#76348)

parent 49c26c7b
// 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 <div />"
`;
exports[`ReactRefreshLogBox turbo 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 <div />"
`;
......@@ -86,13 +86,7 @@ describe('non-root-project-monorepo', () => {
if (stack === null) {
return null
}
const isolatedPath = /file:\/\/.*\/next-install-[^/]+\//g
const nonIsolatedPath =
/file:\/\/.*\/test\/e2e\/app-dir\/non-root-project-monorepo\//g
return stack
.join('\n')
.replaceAll(nonIsolatedPath, 'file://<full-path>/')
.replaceAll(isolatedPath, 'file://<full-path>/')
return stack.join('\n')
}
it('should work on RSC', async () => {
......@@ -134,8 +128,8 @@ describe('non-root-project-monorepo', () => {
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
.toMatchInlineSnapshot(`
"eval app/separate-file.ts (1:11)
<unknown> rsc)/./app/separate-file.ts (rsc://React/Server/file://<full-path>/apps/web/.next/server/app/source-maps-rsc/page.js?3 (63:1)
__webpack_require__ rsc:/Server/file://<full-path>/apps/web/.next/server/webpack-runtime.js (33:42)
<FIXME-file-protocol>
<FIXME-file-protocol>
innerArrowFunction app/source-maps-rsc/page.tsx (14:3)
innerFunction app/source-maps-rsc/page.tsx (10:3)
Page app/source-maps-rsc/page.tsx (4:5)"
......@@ -177,10 +171,10 @@ describe('non-root-project-monorepo', () => {
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
.toMatchInlineSnapshot(`
"eval app/separate-file.ts (1:7)
./app/separate-file.ts file://<full-path>/apps/web/.next/static/chunks/app/source-maps-ssr/page.js (49:1)
options.factory file://<full-path>/apps/web/.next/static/chunks/webpack.js (700:31)
__webpack_require__ file://<full-path>/apps/web/.next/static/chunks/webpack.js (37:33)
fn file://<full-path>/apps/web/.next/static/chunks/webpack.js (357:21)
<FIXME-file-protocol>
<FIXME-file-protocol>
<FIXME-file-protocol>
<FIXME-file-protocol>
innerArrowFunction app/source-maps-ssr/page.tsx (16:3)
innerFunction app/source-maps-ssr/page.tsx (12:3)
Page app/source-maps-ssr/page.tsx (6:5)"
......@@ -222,10 +216,10 @@ describe('non-root-project-monorepo', () => {
expect(normalizeStackTrace(await getRedboxCallStack(browser)))
.toMatchInlineSnapshot(`
"eval app/separate-file.ts (1:7)
./app/separate-file.ts file://<full-path>/apps/web/.next/static/chunks/app/source-maps-client/page.js (49:1)
options.factory file://<full-path>/apps/web/.next/static/chunks/webpack.js (712:31)
__webpack_require__ file://<full-path>/apps/web/.next/static/chunks/webpack.js (37:33)
fn file://<full-path>/apps/web/.next/static/chunks/webpack.js (369:21)
<FIXME-file-protocol>
<FIXME-file-protocol>
<FIXME-file-protocol>
<FIXME-file-protocol>
innerArrowFunction app/source-maps-client/page.tsx (17:3)
innerFunction app/source-maps-client/page.tsx (13:3)
effectCallback app/source-maps-client/page.tsx (7:5)"
......
......@@ -1417,6 +1417,8 @@ export async function getRedboxCallStack(
stack.push('<FIXME-internal-frame>')
}
foundInternalFrame = true
} else if (frame.includes('file://')) {
stack.push('<FIXME-file-protocol>')
} else {
stack.push(frame)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment