diff --git a/test/e2e/og-api/index.test.ts b/test/e2e/og-api/index.test.ts index 9a245bff00fcb8..57ca39b7a05853 100644 --- a/test/e2e/og-api/index.test.ts +++ b/test/e2e/og-api/index.test.ts @@ -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) } })