Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
05f4b877
Unverified
Commit
05f4b877
authored
Feb 23, 2025
by
Sebastian "Sebbie" Silbermann
Committed by
GitHub
Feb 23, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] Use new Redbox matchers in pages/ error-recovery test (#76348)
parent
49c26c7b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
356 additions
and
157 deletions
+356
-157
error-recovery.test.ts.snap
...ment/acceptance/__snapshots__/error-recovery.test.ts.snap
+0
-25
error-recovery.test.ts
test/development/acceptance/error-recovery.test.ts
+343
-115
non-root-project-monorepo.test.ts
...n-root-project-monorepo/non-root-project-monorepo.test.ts
+11
-17
next-test-utils.ts
test/lib/next-test-utils.ts
+2
-0
No files found.
test/development/acceptance/__snapshots__/error-recovery.test.ts.snap
deleted
100644 → 0
View file @
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 />"
`;
test/development/acceptance/error-recovery.test.ts
View file @
05f4b877
This diff is collapsed.
Click to expand it.
test/e2e/app-dir/non-root-project-monorepo/non-root-project-monorepo.test.ts
View file @
05f4b877
...
@@ -86,13 +86,7 @@ describe('non-root-project-monorepo', () => {
...
@@ -86,13 +86,7 @@ describe('non-root-project-monorepo', () => {
if
(
stack
===
null
)
{
if
(
stack
===
null
)
{
return
null
return
null
}
}
const
isolatedPath
=
/file:
\/\/
.*
\/
next-install-
[^/]
+
\/
/g
return
stack
.
join
(
'
\
n'
)
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>/'
)
}
}
it
(
'should work on RSC'
,
async
()
=>
{
it
(
'should work on RSC'
,
async
()
=>
{
...
@@ -134,8 +128,8 @@ describe('non-root-project-monorepo', () => {
...
@@ -134,8 +128,8 @@ describe('non-root-project-monorepo', () => {
expect
(
normalizeStackTrace
(
await
getRedboxCallStack
(
browser
)))
expect
(
normalizeStackTrace
(
await
getRedboxCallStack
(
browser
)))
.
toMatchInlineSnapshot
(
`
.
toMatchInlineSnapshot
(
`
"eval app/separate-file.ts (1:11)
"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)
<
FIXME-file-protocol>
__webpack_require__ rsc:/Server/file://<full-path>/apps/web/.next/server/webpack-runtime.js (33:42)
<FIXME-file-protocol>
innerArrowFunction app/source-maps-rsc/page.tsx (14:3)
innerArrowFunction app/source-maps-rsc/page.tsx (14:3)
innerFunction app/source-maps-rsc/page.tsx (10:3)
innerFunction app/source-maps-rsc/page.tsx (10:3)
Page app/source-maps-rsc/page.tsx (4:5)"
Page app/source-maps-rsc/page.tsx (4:5)"
...
@@ -177,10 +171,10 @@ describe('non-root-project-monorepo', () => {
...
@@ -177,10 +171,10 @@ describe('non-root-project-monorepo', () => {
expect
(
normalizeStackTrace
(
await
getRedboxCallStack
(
browser
)))
expect
(
normalizeStackTrace
(
await
getRedboxCallStack
(
browser
)))
.
toMatchInlineSnapshot
(
`
.
toMatchInlineSnapshot
(
`
"eval app/separate-file.ts (1:7)
"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)
<FIXME-file-protocol>
options.factory file://<full-path>/apps/web/.next/static/chunks/webpack.js (700:31)
<FIXME-file-protocol>
__webpack_require__ file://<full-path>/apps/web/.next/static/chunks/webpack.js (37:33)
<FIXME-file-protocol>
fn file://<full-path>/apps/web/.next/static/chunks/webpack.js (357:21)
<FIXME-file-protocol>
innerArrowFunction app/source-maps-ssr/page.tsx (16:3)
innerArrowFunction app/source-maps-ssr/page.tsx (16:3)
innerFunction app/source-maps-ssr/page.tsx (12:3)
innerFunction app/source-maps-ssr/page.tsx (12:3)
Page app/source-maps-ssr/page.tsx (6:5)"
Page app/source-maps-ssr/page.tsx (6:5)"
...
@@ -222,10 +216,10 @@ describe('non-root-project-monorepo', () => {
...
@@ -222,10 +216,10 @@ describe('non-root-project-monorepo', () => {
expect
(
normalizeStackTrace
(
await
getRedboxCallStack
(
browser
)))
expect
(
normalizeStackTrace
(
await
getRedboxCallStack
(
browser
)))
.
toMatchInlineSnapshot
(
`
.
toMatchInlineSnapshot
(
`
"eval app/separate-file.ts (1:7)
"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)
<FIXME-file-protocol>
options.factory file://<full-path>/apps/web/.next/static/chunks/webpack.js (712:31)
<FIXME-file-protocol>
__webpack_require__ file://<full-path>/apps/web/.next/static/chunks/webpack.js (37:33)
<FIXME-file-protocol>
fn file://<full-path>/apps/web/.next/static/chunks/webpack.js (369:21)
<FIXME-file-protocol>
innerArrowFunction app/source-maps-client/page.tsx (17:3)
innerArrowFunction app/source-maps-client/page.tsx (17:3)
innerFunction app/source-maps-client/page.tsx (13:3)
innerFunction app/source-maps-client/page.tsx (13:3)
effectCallback app/source-maps-client/page.tsx (7:5)"
effectCallback app/source-maps-client/page.tsx (7:5)"
...
...
test/lib/next-test-utils.ts
View file @
05f4b877
...
@@ -1417,6 +1417,8 @@ export async function getRedboxCallStack(
...
@@ -1417,6 +1417,8 @@ export async function getRedboxCallStack(
stack
.
push
(
'<FIXME-internal-frame>'
)
stack
.
push
(
'<FIXME-internal-frame>'
)
}
}
foundInternalFrame
=
true
foundInternalFrame
=
true
}
else
if
(
frame
.
includes
(
'file://'
))
{
stack
.
push
(
'<FIXME-file-protocol>'
)
}
else
{
}
else
{
stack
.
push
(
frame
)
stack
.
push
(
frame
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment