Skip to content

Commit ff19a65

Browse files
committed
Fix existing tests
1 parent 60b49b3 commit ff19a65

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

test/e2e/middleware-general/app/middleware-node.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import { getSomeData } from './lib/some-data'
44
import magicValue from 'shared-package'
55

66
export const config = {
7+
// Matcher needed to test internal routes /_next/ (skipped by default)
8+
matcher: [
9+
'/:path*',
10+
{
11+
source: '/_next/:path*',
12+
locale: false,
13+
},
14+
],
715
regions: 'auto',
816
runtime: 'nodejs',
917
}

test/e2e/middleware-general/app/middleware.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import { getSomeData } from './lib/some-data'
44
import magicValue from 'shared-package'
55

66
export const config = {
7+
// Matcher needed to test internal routes /_next/ (skipped by default)
8+
matcher: [
9+
'/:path*',
10+
{
11+
source: '/_next/:path*',
12+
locale: false,
13+
},
14+
],
715
regions: 'auto',
816
}
917

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,14 @@ const params = (url) => {
104104
}
105105
return result
106106
}
107+
108+
// Matcher needed to test internal routes /_next/ (skipped by default)
109+
export const config = {
110+
matcher: [
111+
'/:path*',
112+
{
113+
source: '/_next/:path*',
114+
locale: false,
115+
},
116+
],
117+
}

test/e2e/skip-trailing-slash-redirect/app/middleware.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,14 @@ export default function handler(req) {
8787

8888
return NextResponse.next()
8989
}
90+
91+
// Matcher needed to test internal routes /_next/ (skipped by default)
92+
export const config = {
93+
matcher: [
94+
'/:path*',
95+
{
96+
source: '/_next/:path*',
97+
locale: false,
98+
},
99+
],
100+
}

test/integration/next-image-new/middleware/middleware.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ export async function middleware(request) {
88
console.log(`x-_next-image: ${request.nextUrl.searchParams.get('url')}`)
99
}
1010
}
11+
12+
// Matcher needed to test internal routes /_next/ (skipped by default)
13+
export const config = {
14+
matcher: [
15+
'/:path*',
16+
{
17+
source: '/_next/:path*',
18+
locale: false,
19+
},
20+
],
21+
}

0 commit comments

Comments
 (0)