Skip to content

Commit

Permalink
Improve chunk encoding test to check right path for Turbopack
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Oct 12, 2023
1 parent ebebb6a commit a1efa93
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/e2e/app-dir/app/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ createNextDescribe(
? 'pnpm next experimental-compile'
: undefined,
},
({ next, isNextDev: isDev, isNextStart, isNextDeploy }) => {
({ next, isNextDev: isDev, isNextStart, isNextDeploy, isTurbopack }) => {
if (process.env.NEXT_EXPERIMENTAL_COMPILE) {
it('should provide query for getStaticProps page correctly', async () => {
const res = await next.fetch('/ssg?hello=world')
Expand Down Expand Up @@ -192,10 +192,13 @@ createNextDescribe(
await check(async () => {
return requests.some(
(req) =>
req.includes(encodeURI('/[category]/[id]')) && req.endsWith('.js')
req.includes(
encodeURI(isTurbopack ? '[category]_[id]' : '/[category]/[id]')
) && req.endsWith('.js')
)
? 'found'
: JSON.stringify(requests)
: // When it fails will log out the paths.
JSON.stringify(requests)
}, 'found')
})

Expand Down

0 comments on commit a1efa93

Please sign in to comment.