Files
Jiachi LiuandGitHub 276fd521d0 Include proper instrumentation entry in required files manifest (#68983)
### What

When the `edge-instrumentation.js` is not built, we do not include it
into the serve required manifest.

We moved the write of required server files manifest to a late phase,
where we used the edge routes counter to determine if we need to write
the edge entry file of instrumentation into manifest

x-ref:
https://github.com/vercel/next.js/actions/runs/10416595866/job/28850695138
2024-08-19 16:12:14 +02:00

20 lines
588 B
TypeScript

import { nextTestSetup } from 'e2e-utils'
async function readRequiredFilesManifest(next: any) {
const manifest = JSON.parse(
await next.readFile('.next/required-server-files.json')
)
return manifest.files
}
describe('instrumentation - required-files-instrumentation-entry', () => {
const { next } = nextTestSetup({
files: __dirname,
})
it('should not contain edge entry in required files manifest', async () => {
const requiredFiles = await readRequiredFilesManifest(next)
expect(requiredFiles).not.toContain('.next/server/edge-instrumentation.js')
})
})