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);