@@ -261,26 +261,29 @@ describe("aborts middleware execution when the matcher conditions don't match th
261
261
262
262
ctx . cleanup ?. push ( ( ) => origin . stop ( ) )
263
263
264
- for ( const path of [ '/hello' , '/en/hello' , '/nl-NL /hello' , '/nl-NL /about' ] ) {
264
+ for ( const path of [ '/hello' , '/en/hello' , '/nl/hello' , '/nl/about' ] ) {
265
265
const response = await invokeEdgeFunction ( ctx , {
266
266
functions : [ '___netlify-edge-handler-middleware' ] ,
267
267
origin,
268
268
url : path ,
269
269
} )
270
- expect ( response . headers . has ( 'x-hello-from-middleware-res' ) , `does match ${ path } ` ) . toBeTruthy ( )
270
+ expect (
271
+ response . headers . has ( 'x-hello-from-middleware-res' ) ,
272
+ `should match ${ path } ` ,
273
+ ) . toBeTruthy ( )
271
274
expect ( await response . text ( ) ) . toBe ( 'Hello from origin!' )
272
275
expect ( response . status ) . toBe ( 200 )
273
276
}
274
277
275
- for ( const path of [ '/hello/invalid' , '/about' , '/en/about' ] ) {
278
+ for ( const path of [ '/invalid/hello' , '/ hello/invalid', '/about' , '/en/about' ] ) {
276
279
const response = await invokeEdgeFunction ( ctx , {
277
280
functions : [ '___netlify-edge-handler-middleware' ] ,
278
281
origin,
279
282
url : path ,
280
283
} )
281
284
expect (
282
285
response . headers . has ( 'x-hello-from-middleware-res' ) ,
283
- `does not match ${ path } ` ,
286
+ `should not match ${ path } ` ,
284
287
) . toBeFalsy ( )
285
288
expect ( await response . text ( ) ) . toBe ( 'Hello from origin!' )
286
289
expect ( response . status ) . toBe ( 200 )
0 commit comments