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
72baaebb
Unverified
Commit
72baaebb
authored
Jan 30, 2023
by
Hannes Bornö
Committed by
GitHub
Jan 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move error recovery test to new file (#45407)
parent
c7deecfd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
513 additions
and
609 deletions
+513
-609
ReactRefreshLogBox.test.ts
test/development/acceptance-app/ReactRefreshLogBox.test.ts
+0
-493
ReactRefreshLogBox.test.ts.snap
...eptance-app/__snapshots__/ReactRefreshLogBox.test.ts.snap
+0
-116
error-recovery.test.ts
test/development/acceptance-app/error-recovery.test.ts
+504
-0
page.js
...ceptance-app/fixtures/default-template/app/client/page.js
+5
-0
page.js
...ceptance-app/fixtures/default-template/app/server/page.js
+4
-0
No files found.
test/development/acceptance-app/ReactRefreshLogBox.test.ts
View file @
72baaebb
This diff is collapsed.
Click to expand it.
test/development/acceptance-app/__snapshots__/ReactRefreshLogBox.test.ts.snap
View file @
72baaebb
...
...
@@ -76,45 +76,6 @@ exports[`ReactRefreshLogBox app default logbox: anchors links in error messages
exports[`ReactRefreshLogBox app default logbox: anchors links in error messages 9`] = `"http://example.com/"`;
exports[`ReactRefreshLogBox app default logbox: can recover from a component error 1`] = `
"child.js (4:16) @ Child
2 | // hello
3 | export default function Child() {
> 4 | throw new Error('oops')
| ^
5 | }
6 | "
`;
exports[`ReactRefreshLogBox app default logbox: can recover from a event handler error 1`] = `
"index.js (8:18) @ eval
6 | const increment = useCallback(() => {
7 | setCount(c => c + 1)
> 8 | throw new Error('oops')
| ^
9 | }, [setCount])
10 | return (
11 | <main>"
`;
exports[`ReactRefreshLogBox app default logbox: can recover from a syntax error without losing state 1`] = `
"./index.js
Error:
x Unexpected eof
,----
1 | export default () => <div/
\`----
Caused by:
Syntax Error
Import trace for requested module:
./index.js
./app/page.js"
`;
exports[`ReactRefreshLogBox app default module init error not shown 1`] = `
"index.js (4:14) @ eval
...
...
@@ -127,18 +88,6 @@ exports[`ReactRefreshLogBox app default module init error not shown 1`] = `
7 | return <h1>Default Export</h1>;"
`;
exports[`ReactRefreshLogBox app default render error not shown right after syntax error 1`] = `
"index.js (6:18) @ ClassDefault.render
4 | class ClassDefault extends React.Component {
5 | render() {
> 6 | throw new Error('nooo');
| ^
7 | return <h1>Default Export</h1>;
8 | }
9 | }"
`;
exports[`ReactRefreshLogBox app default should strip whitespace correctly with newline 1`] = `
"index.js (9:34) @ onClick
...
...
@@ -151,71 +100,6 @@ exports[`ReactRefreshLogBox app default should strip whitespace correctly with n
12 | </a>"
`;
exports[`ReactRefreshLogBox app default stuck error 1`] = `
"Foo.js (4:10) @ Foo
2 | // intentionally skips export
3 | export default function Foo() {
> 4 | return React.createElement('h1', null, 'Foo');
| ^
5 | }
6 | "
`;
exports[`ReactRefreshLogBox app default syntax > runtime error 1`] = `
"index.js (6:16) @ Error
4 | setInterval(() => {
5 | i++
> 6 | throw Error('no ' + i)
| ^
7 | }, 1000)
8 | export default function FunctionNamed() {
9 | return <div />"
`;
exports[`ReactRefreshLogBox app default syntax > runtime error 2`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,-[5:1]
5 | i++
6 | throw Error('no ' + i)
7 | }, 1000)
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
0: error was recoverable, but proceeding would result in wrong codegen
1: Syntax Error
Import trace for requested module:
./index.js
./app/page.js"
`;
exports[`ReactRefreshLogBox app default syntax > runtime error 3`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,-[5:1]
5 | i++
6 | throw Error('no ' + i)
7 | }, 1000)
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
0: error was recoverable, but proceeding would result in wrong codegen
1: Syntax Error
Import trace for requested module:
./index.js
./app/page.js"
`;
exports[`ReactRefreshLogBox app default unterminated JSX 1`] = `
"./index.js
Error:
...
...
test/development/acceptance-app/error-recovery.test.ts
0 → 100644
View file @
72baaebb
This diff is collapsed.
Click to expand it.
test/development/acceptance-app/fixtures/default-template/app/client/page.js
0 → 100644
View file @
72baaebb
'use client'
import
Component
from
'../../index'
export
default
function
Page
()
{
return
<
Component
/>
}
test/development/acceptance-app/fixtures/default-template/app/server/page.js
0 → 100644
View file @
72baaebb
import
Component
from
'../../index'
export
default
function
Page
()
{
return
<
Component
/>
}
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