Skip to content

Commit 9fcd6b4

Browse files
committed
test: adjust integration tests redirect assertions
1 parent dbde615 commit 9fcd6b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/integration/middleware.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ for (const {
130130
expect(response.status).toBe(307)
131131
expect(response.headers.get('location'), 'added a location header').toBeTypeOf('string')
132132
expect(
133-
new URL(response.headers.get('location') as string).pathname,
133+
new URL(response.headers.get('location') as string, 'http://n').pathname,
134134
'redirected to the correct path',
135135
).toEqual('/other')
136136
expect(response.headers.get('x-runtime')).toEqual(expectedRuntime)
@@ -154,7 +154,7 @@ for (const {
154154
expect(response.status).toBe(307)
155155
expect(response.headers.get('location'), 'added a location header').toBeTypeOf('string')
156156
expect(
157-
new URL(response.headers.get('location') as string).pathname,
157+
new URL(response.headers.get('location') as string, 'http://n').pathname,
158158
'redirected to the correct path',
159159
).toEqual('/other')
160160
expect(response.headers.get('x-header-from-redirect'), 'hello').toBe('hello')
@@ -357,7 +357,7 @@ for (const {
357357
expect(response.status).toBe(307)
358358
expect(response.headers.get('location'), 'added a location header').toBeTypeOf('string')
359359
expect(
360-
new URL(response.headers.get('location') as string).pathname,
360+
new URL(response.headers.get('location') as string, 'http://n').pathname,
361361
'redirected to the correct path',
362362
).toEqual('/other')
363363
expect(response.headers.get('x-header-from-redirect'), 'hello').toBe('hello')
@@ -382,7 +382,7 @@ for (const {
382382
expect(response.status).toBe(307)
383383
expect(response.headers.get('location'), 'added a location header').toBeTypeOf('string')
384384
expect(
385-
new URL(response.headers.get('location') as string).pathname,
385+
new URL(response.headers.get('location') as string, 'http://n').pathname,
386386
'redirected to the correct path',
387387
).toEqual('/other')
388388
expect(response.headers.get('x-header-from-redirect'), 'hello').toBe('hello')

0 commit comments

Comments
 (0)