import { readFileSync } from 'node:fs' import { describe, expect, it } from 'vitest' // `next build` rewrites tsconfig.json when the values differ from what Next 16 // mandates (jsx: react-jsx, .next/dev/types in include), dirtying the checkout on // every build. The shipped file must already hold them. const tsconfig = JSON.parse(readFileSync(new URL('../tsconfig.json', import.meta.url), 'utf8')) as { compilerOptions: { jsx?: string } include: string[] } describe('tsconfig holds the values Next 16 mandates', () => { it('uses the React automatic runtime jsx setting', () => { expect(tsconfig.compilerOptions.jsx).toBe('react-jsx') }) it('includes the dev types directory', () => { expect(tsconfig.include).toContain('.next/dev/types/**/*.ts') }) })