Skip to content

Commit 1d7549f

Browse files
committed
Make tests pass for all node versions
1 parent 4bae210 commit 1d7549f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/integration/middleware/core/test/index.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function urlTests(locale = '') {
122122
`${locale}/urls/relative-url`
123123
)
124124
const json = await res.json()
125-
expect(json.error.message).toEqual('Invalid URL')
125+
expect(json.error.message).toContain('Invalid URL')
126126
})
127127

128128
it('throws when using Request with a relative URL', async () => {
@@ -131,7 +131,7 @@ function urlTests(locale = '') {
131131
`${locale}/urls/relative-request`
132132
)
133133
const json = await res.json()
134-
expect(json.error.message).toEqual('Invalid URL')
134+
expect(json.error.message).toContain('Invalid URL')
135135
})
136136

137137
it('throws when using Response.redirect with a relative URL', async () => {
@@ -140,7 +140,7 @@ function urlTests(locale = '') {
140140
`${locale}/urls/relative-redirect`
141141
)
142142
const json = await res.json()
143-
expect(json.error.message).toEqual('Invalid URL')
143+
expect(json.error.message).toContain('Invalid URL')
144144
})
145145

146146
it('throws when using NextRequest with a relative URL', async () => {
@@ -149,7 +149,7 @@ function urlTests(locale = '') {
149149
`${locale}/urls/relative-next-request`
150150
)
151151
const json = await res.json()
152-
expect(json.error.message).toEqual('Invalid URL')
152+
expect(json.error.message).toContain('Invalid URL')
153153
})
154154

155155
it('throws when using NextResponse.redirect with a relative URL', async () => {
@@ -158,7 +158,7 @@ function urlTests(locale = '') {
158158
`${locale}/urls/relative-next-redirect`
159159
)
160160
const json = await res.json()
161-
expect(json.error.message).toEqual('Invalid URL')
161+
expect(json.error.message).toContain('Invalid URL')
162162
})
163163

164164
it('throws when using NextResponse.rewrite with a relative URL', async () => {
@@ -167,7 +167,7 @@ function urlTests(locale = '') {
167167
`${locale}/urls/relative-next-rewrite`
168168
)
169169
const json = await res.json()
170-
expect(json.error.message).toEqual('Invalid URL')
170+
expect(json.error.message).toContain('Invalid URL')
171171
})
172172
}
173173

0 commit comments

Comments
 (0)