From 710436bc2ea29e9ffb3dfaeed60215ff9a537c75 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sat, 26 Sep 2026 00:22:08 +0900 Subject: [PATCH] fix(ci): pin each diagnostics fixture violation with its own ts-expect-error (07-05) The gate only matched one diagnostic string, so widening the telemetry event name or the diagnostic level still counted as the expected failure. Each violation now has its own directive and the fixture must compile cleanly. Co-Authored-By: Claude Opus 5.5 --- config/ci/gates.json | 4 +--- tests/fixtures/typecheck/invalid-diagnostics-port.ts | 9 +++++++++ tests/unit/ci-workflow-generation.test.ts | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/ci/gates.json b/config/ci/gates.json index 3778db53..b4ea16ec 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -177,9 +177,7 @@ { "id": "check-types-fixture-diagnostics", "script": "check:types:fixture:diagnostics", - "expect": "fail", - "expectedExitCode": 1, - "expectedDiagnosticId": "UNKNOWN_DIAGNOSTIC_EVENT" + "expect": "pass" }, { "id": "check-types-fixture-image-resolve-signal", diff --git a/tests/fixtures/typecheck/invalid-diagnostics-port.ts b/tests/fixtures/typecheck/invalid-diagnostics-port.ts index abe7fcdc..68861186 100644 --- a/tests/fixtures/typecheck/invalid-diagnostics-port.ts +++ b/tests/fixtures/typecheck/invalid-diagnostics-port.ts @@ -4,8 +4,17 @@ import type { TelemetryPort } from "../../../src/application/ports/telemetry-por declare const diagnostics: DiagnosticsPort; declare const telemetry: TelemetryPort; +// 07-05. One violation per directive: if a port type widens, its directive +// becomes unused (TS2578) and this fixture stops compiling. diagnostics.record({ + // @ts-expect-error "fatal" is not a diagnostic level. level: "fatal", + eventId: "route.changed", +}); +diagnostics.record({ + level: "info", + // @ts-expect-error the diagnostic event id is not registered. eventId: "UNKNOWN_DIAGNOSTIC_EVENT", }); +// @ts-expect-error the telemetry event name is not registered. telemetry.emit("unknown.telemetry.event", {}); diff --git a/tests/unit/ci-workflow-generation.test.ts b/tests/unit/ci-workflow-generation.test.ts index e237df08..0866cc38 100644 --- a/tests/unit/ci-workflow-generation.test.ts +++ b/tests/unit/ci-workflow-generation.test.ts @@ -196,7 +196,7 @@ describe("CI gate contract", () => { expect(contract.jobs).toHaveLength(9); expect(contract.commands).toHaveLength(95); expect(contract.gates.reduce((total, gate) => total + gate.commandIds.length, 0)).toBe(105); - expect(contract.commands.filter(({ expect }) => expect === "fail")).toHaveLength(31); + expect(contract.commands.filter(({ expect }) => expect === "fail")).toHaveLength(30); expect(contract.gates.reduce((total, gate) => total + gate.evidenceArtifactIds.length, 0)).toBe(87); expect(contract.artifacts).toHaveLength(109); expect(contract.stages).toHaveLength(5);