You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Circular structure in "getInitialProps" result of page "/circular-json-error".'
137
130
138
-
awaitassertHasRedbox(browser)
139
-
consttext=awaitgetRedboxHeader(browser)
140
-
expect(text).toContain(expectedErrorMessage)
131
+
if(isReact18&&isTurbopack){
132
+
awaitexpect(browser).toDisplayRedbox(`
133
+
{
134
+
"count": 1,
135
+
"description": "Error: Circular structure in "getInitialProps" result of page "/circular-json-error". https://nextjs.org/docs/messages/circular-structure",
136
+
"environmentLabel": null,
137
+
"label": "Runtime Error",
138
+
"source": null,
139
+
"stack": [
140
+
"new Promise <anonymous> (0:0)",
141
+
],
142
+
}
143
+
`)
144
+
}else{
145
+
awaitexpect(browser).toDisplayRedbox(`
146
+
{
147
+
"count": 1,
148
+
"description": "Error: Circular structure in "getInitialProps" result of page "/circular-json-error". https://nextjs.org/docs/messages/circular-structure",
149
+
"environmentLabel": null,
150
+
"label": "Runtime Error",
151
+
"source": null,
152
+
"stack": [],
153
+
}
154
+
`)
155
+
}
141
156
})
142
157
143
158
test('getInitialProps should be class method',async()=>{
'"InstanceInitialPropsPage.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.'
151
-
152
-
awaitassertHasRedbox(browser)
153
-
consttext=awaitgetRedboxHeader(browser)
154
-
expect(text).toContain(expectedErrorMessage)
164
+
awaitexpect(browser).toDisplayRedbox(`
165
+
{
166
+
"count": 1,
167
+
"description": "Error: "InstanceInitialPropsPage.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.",
168
+
"environmentLabel": null,
169
+
"label": "Runtime Error",
170
+
"source": null,
171
+
"stack": [],
172
+
}
173
+
`)
155
174
})
156
175
157
176
test('getInitialProps resolves to null',async()=>{
0 commit comments