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 d5dc6b2 commit 7e7a99c
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions test/e2e/og-api/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,20 @@ describe('og-api', () => {
it('should copy files correctly', async () => {
expect(next.cliOutput).not.toContain('Failed to copy traced files')

if (process.env.TURBOPACK) {
expect(
await fs.pathExists(
join(
next.testDir,
'.next/standalone/.next/server/pages/api/og/middleware-manifest.json'
)
)
).toBe(true)
expect(
await fs.pathExists(
join(next.testDir, '.next/standalone/.next/server/edge/chunks')
)
).toBe(true)
} else {
expect(
await fs.pathExists(
join(next.testDir, '.next/standalone/.next/server/pages/api/og.js')
)
).toBe(true)
let manifest = await fs.readJSON(
join(
next.testDir,
'.next/standalone/.next/server/middleware-manifest.json'
)
)
let apiOg = manifest.functions['/api/og']
let files = apiOg.files.concat(
[...apiOg.wasm, ...apiOg.assets].map((f) => f.filePath)
)

for (let f of files) {
expect(
await fs.pathExists(
join(next.testDir, '.next/standalone/.next/server/edge-chunks')
)
await fs.pathExists(join(next.testDir, '.next/standalone/.next', f))
).toBe(true)
}
})
Expand Down

0 comments on commit 7e7a99c

Please sign in to comment.