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
test: Refactor edge-runtime-dynamic-code test (#83390)
This test is about `eval`
But it also used a non-static middleware `matchers` config, which is going to break once we are more strict about this and throw a build error.
it('does not issue dynamic code evaluation warnings',async()=>{
46
46
consthtml=awaitrenderViaHTTP(context.appPort,'/')
47
47
expect(html).toMatch(/>.*?100.*?and.*?100.*?<\//)
48
48
awaitwaitFor(500)
@@ -108,10 +108,10 @@ describe.each([
108
108
isTurbopack
109
109
? ''+
110
110
// TODO(veil): Turbopack duplicates project path
111
-
'\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:11:17)'+
111
+
'\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:3:17)'+
112
112
'\n at middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:12:54)'+
113
-
'\n 9 | export async function usingEval() {'
114
-
: '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:11:19)'+
113
+
'\n 1 | export async function usingEval() {'
114
+
: '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:3:19)'+
115
115
'\n at middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:12:54)'+
116
116
// Next.js internal frame. Feel free to adjust.
117
117
// Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules
@@ -122,27 +122,27 @@ describe.each([
122
122
isTurbopack
123
123
? ''+
124
124
// TODO(veil): Turbopack duplicates project path
125
-
'\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:11:17)'+
126
-
'\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:13:24)'+
127
-
'\n 9 | export async function usingEval() {'
128
-
: '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:11:19)'+
129
-
'\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:13:24)'+
130
-
'\n 9 | export async function usingEval() {'
125
+
'\n at usingEval (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/utils.js:3:17)'+
126
+
'\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:12:41)'+
127
+
'\n 1 | export async function usingEval() {'
128
+
: '\n at usingEval (../../test/integration/edge-runtime-dynamic-code/lib/utils.js:3:19)'+
129
+
'\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:12:41)'+
130
+
'\n 1 | export async function usingEval() {'
131
131
)
132
132
}
133
133
134
134
// Turbopack produces incorrect mappings in the sourcemap.
135
135
if(isTurbopack){
136
136
expect(output).toContain(
137
137
''+
138
-
"\n> 11 | return { value: eval('100') }"+
139
-
'\n | ^'
138
+
"\n> 3 | return { value: eval('100') }"+
139
+
'\n | ^'
140
140
)
141
141
}else{
142
142
expect(output).toContain(
143
143
''+
144
-
"\n> 11 | return { value: eval('100') }"+
145
-
'\n | ^'
144
+
"\n> 3 | return { value: eval('100') }"+
145
+
'\n | ^'
146
146
)
147
147
}
148
148
})
@@ -189,14 +189,12 @@ describe.each([
189
189
? ''+
190
190
// TODO(veil): Turbopack duplicates project path
191
191
'\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:18)'+
192
-
'\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:17:42)'+
192
+
'\n at handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:20:55)'+
193
193
'\n 20 |'
194
194
: ''+
195
195
'\n at usingWebAssemblyCompile (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:22:24)'+
196
-
'\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:17:42)'+
197
-
// Next.js internal frame. Feel free to adjust.
198
-
// Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules
199
-
'\n at'
196
+
'\n at handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:20:55)'+
197
+
'\n 20 |'
200
198
)
201
199
202
200
// Turbopack produces incorrect mappings in the sourcemap.
@@ -230,11 +228,11 @@ describe.each([
230
228
isTurbopack
231
229
? ''+
232
230
'\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)'+
233
-
'\n at async middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:37:30)'+
231
+
'\n at async middleware (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/middleware.js:39:30)'+
234
232
'\n 26 |\n'
235
233
: ''+
236
234
'\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)'+
237
-
'\n at async middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:37:30)'+
235
+
'\n at async middleware (../../test/integration/edge-runtime-dynamic-code/middleware.js:39:30)'+
'\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)'+
253
-
'\n at async handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:21:17)'+
251
+
'\n at async handler (../../test/integration/edge-runtime-dynamic-code/test/integration/edge-runtime-dynamic-code/pages/api/route.js:28:26)'+
254
252
'\n 26 |'
255
253
: ''+
256
254
'\n at async usingWebAssemblyInstantiateWithBuffer (../../test/integration/edge-runtime-dynamic-code/lib/wasm.js:28:24)'+
257
-
'\n at async handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:21:17)'+
258
-
// Next.js internal frame. Feel free to adjust.
259
-
// Not ignore-listed because we're not in an isolated app and Next.js is symlinked so it's not in node_modules
260
-
'\n at'
255
+
'\n at async handler (../../test/integration/edge-runtime-dynamic-code/pages/api/route.js:28:26)'+
0 commit comments