Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Turbopack: Fix middleware test #76126

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions test/e2e/app-dir/app-edge/app-edge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,21 @@ describe('app-dir edge SSR', () => {
const manifest = JSON.parse(
await next.readFile('.next/server/middleware-manifest.json')
)
expect(manifest.functions['/(group)/group/page'].matchers).toEqual([
{
regexp: '^/group$',
originalSource: '/group',
},
])
if (process.env.TURBOPACK) {
expect(manifest.functions['/(group)/group/page'].matchers).toEqual([
{
regexp: '^/group(?:/)?$',
originalSource: '/group',
},
])
} else {
expect(manifest.functions['/(group)/group/page'].matchers).toEqual([
{
regexp: '^/group$',
originalSource: '/group',
},
])
}
})
}
})
5 changes: 2 additions & 3 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,10 @@
"app-dir edge SSR should handle /index routes correctly",
"app-dir edge SSR should handle edge only routes",
"app-dir edge SSR should retrieve cookies in a server component in the edge runtime",
"app-dir edge SSR should treat process as object without polyfill in edge runtime"
],
"failed": [
"app-dir edge SSR should treat process as object without polyfill in edge runtime",
"app-dir edge SSR should generate matchers correctly in middleware manifest"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
Expand Down
Loading