import { readFileSync } from "node:fs"; import { describe, expect, it } from "vitest"; import { gatedTestPaths } from "../../scripts/lib/ungated-tests.ts"; /** * 0929/10-05. `test:all` is the local development loop * (docs/testing/taxonomy.md). When it skips a Vitest path the merge gate's * coverage run covers, a change passes locally and fails in CI. */ const scripts = ( JSON.parse(readFileSync("package.json", "utf8")) as { scripts: Record; } ).scripts; const readConfig = (file: string) => readFileSync(file, "utf8"); describe("test:all", () => { it("runs every Vitest path test:coverage runs", () => { const local = gatedTestPaths(scripts, ["test:all"], readConfig); const coverage = gatedTestPaths(scripts, ["test:coverage"], readConfig); expect(coverage.length).toBeGreaterThan(0); expect( coverage.filter( (target) => !local.some((path) => target === path || target.startsWith(`${path}/`)), ), ).toEqual([]); }); });