Skip to content

Commit

Permalink
Review comments: cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Nov 19, 2024
1 parent 9a4abad commit d5dc6b2
Showing 1 changed file with 11 additions and 24 deletions.
35 changes: 11 additions & 24 deletions test/e2e/edge-pages-support/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ describe('edge-render-getserversideprops', () => {
})

if ((global as any).isNextStart) {
it('should not output trace files for edge routes', async () => {
expect(await fs.pathExists(join(next.testDir, '.next/pages'))).toBe(false)
if (process.env.TURBOPACK) {
expect(
await fs.pathExists(
join(
next.testDir,
'.next/server/pages/[id]/middleware-manifest.json'
)
)
).toBe(true)
} else {
// Turbopack doesn't have entry chunks for edge routes like Webpack does, so there is no fixed
// known path where the nft file would be written to.
;(process.env.TURBOPACK ? it : it.skip)(
'should not output trace files for edge routes',
async () => {
/* eslint-disable jest/no-standalone-expect */
expect(await fs.pathExists(join(next.testDir, '.next/pages'))).toBe(
false
)
expect(
await fs.pathExists(join(next.testDir, '.next/server/pages/[id].js'))
).toBe(true)
Expand All @@ -31,17 +28,6 @@ describe('edge-render-getserversideprops', () => {
join(next.testDir, '.next/server/pages/[id].js.nft.json')
)
).toBe(false)
}
if (process.env.TURBOPACK) {
expect(
await fs.pathExists(
join(
next.testDir,
'.next/server/pages/index/middleware-manifest.json'
)
)
).toBe(true)
} else {
expect(
await fs.pathExists(join(next.testDir, '.next/server/pages/index.js'))
).toBe(true)
Expand All @@ -50,8 +36,9 @@ describe('edge-render-getserversideprops', () => {
join(next.testDir, '.next/server/pages/index.js.nft.json')
)
).toBe(false)
/* eslint-enable jest/no-standalone-expect */
}
})
)
}

it('should have correct query for pages/api', async () => {
Expand Down

0 comments on commit d5dc6b2

Please sign in to comment.