import { execFileSync } from 'node:child_process'; import { readFileSync } from 'node:fs'; import { resolve } from 'node:path'; import { describe, expect, it } from 'vitest'; describe('production frontend hygiene', () => { it('keeps Starter demonstrations and Mock fixtures outside the production source tree', () => { const output = execFileSync(process.execPath, ['scripts/check-production-hygiene.mjs'], { cwd: process.cwd(), encoding: 'utf8', }); expect(output).toContain('Production hygiene passed'); }); it('runs the dist scan as part of every release build', () => { const packageJson = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8')); expect(packageJson.scripts.build).toContain('npm run check:dist'); expect(packageJson.scripts['check:dist']).toBe('node scripts/check-production-hygiene.mjs --dist'); }); });