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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
aff5f43652
commit
710436bc2e
@@ -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",
|
||||
|
||||
@@ -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", {});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user