Skip to content

Commit 20c6d01

Browse files
committed
Fix existing tests
1 parent 1859fbe commit 20c6d01

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

test/e2e/middleware-general/test/index.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ describe('Middleware Runtime', () => {
3939
),
4040
},
4141
nextConfig: {
42+
// This test needs to intercept internal routes /_next/ (skipped by default)
43+
skipMiddlewareNextInternalRoutes: false,
4244
experimental: {
4345
webpackBuildWorker: true,
4446
},
@@ -200,9 +202,7 @@ describe('Middleware Runtime', () => {
200202
`/_next/static/${next.buildId}/_devMiddlewareManifest.json`
201203
)
202204
const matchers = await res.json()
203-
expect(matchers).toEqual([
204-
{ regexp: '^/.*$', originalSource: '/:path*' },
205-
])
205+
expect(matchers).toEqual([{ regexp: '.*', originalSource: '/:path*' }])
206206
})
207207
}
208208

@@ -228,7 +228,7 @@ describe('Middleware Runtime', () => {
228228
]),
229229
name: 'middleware',
230230
page: '/',
231-
matchers: [{ regexp: '^/.*$', originalSource: '/:path*' }],
231+
matchers: [{ regexp: '.*', originalSource: '/:path*' }],
232232
wasm: [],
233233
assets: process.env.IS_TURBOPACK_TEST ? expect.toBeArray() : [],
234234
regions: 'auto',

test/e2e/middleware-trailing-slash/app/next.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
module.exports = {
2+
// This test needs to intercept internal routes /_next/ (skipped by default)
3+
skipMiddlewareNextInternalRoutes: false,
24
trailingSlash: true,
35
redirects() {
46
return [

test/e2e/middleware-trailing-slash/test/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('Middleware Runtime trailing slash', () => {
122122
]),
123123
name: 'middleware',
124124
page: '/',
125-
matchers: [{ regexp: '^/.*$', originalSource: '/:path*' }],
125+
matchers: [{ regexp: '.*', originalSource: '/:path*' }],
126126
wasm: [],
127127
assets: process.env.IS_TURBOPACK_TEST ? expect.toBeArray() : [],
128128
})

0 commit comments

Comments
 (0)