Skip to content

Commit a1efa93

Browse files
committed
Improve chunk encoding test to check right path for Turbopack
1 parent ebebb6a commit a1efa93

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/e2e/app-dir/app/index.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ createNextDescribe(
1313
? 'pnpm next experimental-compile'
1414
: undefined,
1515
},
16-
({ next, isNextDev: isDev, isNextStart, isNextDeploy }) => {
16+
({ next, isNextDev: isDev, isNextStart, isNextDeploy, isTurbopack }) => {
1717
if (process.env.NEXT_EXPERIMENTAL_COMPILE) {
1818
it('should provide query for getStaticProps page correctly', async () => {
1919
const res = await next.fetch('/ssg?hello=world')
@@ -192,10 +192,13 @@ createNextDescribe(
192192
await check(async () => {
193193
return requests.some(
194194
(req) =>
195-
req.includes(encodeURI('/[category]/[id]')) && req.endsWith('.js')
195+
req.includes(
196+
encodeURI(isTurbopack ? '[category]_[id]' : '/[category]/[id]')
197+
) && req.endsWith('.js')
196198
)
197199
? 'found'
198-
: JSON.stringify(requests)
200+
: // When it fails will log out the paths.
201+
JSON.stringify(requests)
199202
}, 'found')
200203
})
201204

0 commit comments

Comments
 (0)