forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReactRefreshLogBox.test.ts.snap
184 lines (148 loc) · 4.61 KB
/
ReactRefreshLogBox.test.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ReactRefreshLogBox boundaries 1`] = `
"FunctionDefault.js (1:50) @ FunctionDefault
> 1 | export default function FunctionDefault() { throw new Error('no'); }
| ^"
`;
exports[`ReactRefreshLogBox conversion to class component (1) 1`] = `
"Child.js (5:18) @ ClickCount.render
3 | export default class ClickCount extends Component {
4 | render() {
> 5 | throw new Error()
| ^
6 | }
7 | }
8 | "
`;
exports[`ReactRefreshLogBox css syntax errors 1`] = `
"./index.module.css:1:1
Syntax error: Selector \\"button\\" is not pure (pure selectors must contain at least one local class or id)
> 1 | button {}
| ^"
`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 1`] = `"Error: end http://nextjs.org"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 2`] = `"http://nextjs.org/"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 3`] = `"Error: http://nextjs.org start"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 4`] = `"http://nextjs.org/"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 5`] = `"Error: middle http://nextjs.org end"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 6`] = `"http://nextjs.org/"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 8`] = `"http://nextjs.org/"`;
exports[`ReactRefreshLogBox logbox: anchors links in error messages 9`] = `"http://example.com/"`;
exports[`ReactRefreshLogBox 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 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 logbox: can recover from a syntax error without losing state 1`] = `
"./index.js
Error:
x Unexpected eof
,----
1 | export default () => <div/
: ^
\`----
Caused by:
0: failed to process input file
1: Syntax Error"
`;
exports[`ReactRefreshLogBox module init error not shown 1`] = `
"index.js (4:14) @ eval
2 | // top offset for snapshot
3 | import * as React from 'react';
> 4 | throw new Error('no')
| ^
5 | class ClassDefault extends React.Component {
6 | render() {
7 | return <h1>Default Export</h1>;"
`;
exports[`ReactRefreshLogBox 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 should strip whitespace correctly with newline 1`] = `
"index.js (9:34) @ onClick
7 |
8 | <a onClick={() => {
> 9 | throw new Error('idk')
| ^
10 | }}>
11 | click me
12 | </a>"
`;
exports[`ReactRefreshLogBox 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 syntax > runtime error 1`] = `
"index.js (6:16) @ eval
4 | setInterval(() => {
5 | i++
> 6 | throw Error('no ' + i)
| ^
7 | }, 1000)
8 | export default function FunctionNamed() {
9 | return <div />"
`;
exports[`ReactRefreshLogBox syntax > runtime error 2`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,----
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
0: failed to process input file
1: error was recoverable, but proceeding would result in wrong codegen
2: Syntax Error"
`;
exports[`ReactRefreshLogBox syntax > runtime error 3`] = `
"./index.js
Error:
x Expected '}', got '<eof>'
,----
8 | export default function FunctionNamed() {
: ^
\`----
Caused by:
0: failed to process input file
1: error was recoverable, but proceeding would result in wrong codegen
2: Syntax Error"
`;
exports[`ReactRefreshLogBox unterminated JSX 1`] = `
"./index.js
Error:
x Unexpected eof
,----
9 |
: ^
\`----
Caused by:
0: failed to process input file
1: Syntax Error"
`;