Skip to content

Commit 285dd28

Browse files
committed
test: update edge-runtime test
1 parent 61fe5b9 commit 285dd28

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tests/fixtures/middleware-conditions/middleware.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const config = {
1919
source: '/hello',
2020
},
2121
{
22-
source: '/nl-NL/about',
22+
source: '/nl/about',
2323
locale: false,
2424
},
2525
],

tests/integration/edge-handler.test.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,16 @@ describe("aborts middleware execution when the matcher conditions don't match th
261261

262262
ctx.cleanup?.push(() => origin.stop())
263263

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']) {
265265
const response = await invokeEdgeFunction(ctx, {
266266
functions: ['___netlify-edge-handler-middleware'],
267267
origin,
268268
url: path,
269269
})
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()
271274
expect(await response.text()).toBe('Hello from origin!')
272275
expect(response.status).toBe(200)
273276
}
@@ -280,7 +283,7 @@ describe("aborts middleware execution when the matcher conditions don't match th
280283
})
281284
expect(
282285
response.headers.has('x-hello-from-middleware-res'),
283-
`does not match ${path}`,
286+
`should not match ${path}`,
284287
).toBeFalsy()
285288
expect(await response.text()).toBe('Hello from origin!')
286289
expect(response.status).toBe(200)

0 commit comments

Comments
 (0)