fix: reject empty removal fixture scans
This commit is contained in:
@@ -195,7 +195,26 @@ describe("CI gate contract", () => {
|
||||
await writeFile(path.join(root, "package.json"), await readFile("package.json"));
|
||||
|
||||
await expect(loadCiGateContract(root)).rejects.toThrow(
|
||||
/canonical gate semantic shape|lacks a bound producer command/i,
|
||||
/lacks a bound producer command/i,
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects canonical gate name drift through the semantic-shape digest", async () => {
|
||||
const root = await mkdtemp(path.join(tmpdir(), "ci-contract-gate-name-shape-"));
|
||||
temporaryRoots.push(root);
|
||||
await mkdir(path.join(root, "config/ci"), { recursive: true });
|
||||
const contract = JSON.parse(
|
||||
JSON.stringify(await loadCiGateContract(process.cwd())),
|
||||
) as Record<string, any>;
|
||||
const gate = contract.gates.find(
|
||||
(candidate: Record<string, any>) => candidate.id === "FE-GATE-013",
|
||||
);
|
||||
gate.name = `${gate.name}-renamed`;
|
||||
await writeFile(path.join(root, "config/ci/gates.json"), `${JSON.stringify(contract)}\n`);
|
||||
await writeFile(path.join(root, "package.json"), await readFile("package.json"));
|
||||
|
||||
await expect(loadCiGateContract(root)).rejects.toThrow(
|
||||
/canonical gate semantic shape/i,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user