From 6bbbcf75d49ca4029875bdffdfa3d63325535981 Mon Sep 17 00:00:00 2001 From: SIAX Agent Date: Sat, 7 Nov 2026 18:15:04 +0100 Subject: [PATCH] =?UTF-8?q?test(lint):=20typa=20idempotency-store=20i=20st?= =?UTF-8?q?=C3=A4llet=20f=C3=B6r=20any=20(blockerar=20quality-gaten)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/siax-access/idempotency.test.ts hade fyra @typescript-eslint/no-explicit-any vilket fick quality-jobbet att exita 1 (133 testfiler gröna men lint röd) och därmed blockerade alla PR:er. Använder exporterade IdempotencyStore; eslint rent, 7/7 tester gröna. --- tests/siax-access/idempotency.test.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/siax-access/idempotency.test.ts b/tests/siax-access/idempotency.test.ts index b85f5fe..674e9a0 100644 --- a/tests/siax-access/idempotency.test.ts +++ b/tests/siax-access/idempotency.test.ts @@ -1,5 +1,10 @@ import { describe, expect, it } from "vitest"; -import { operationFingerprint, operationIdentity, runIdempotentOperation } from "../../packages/siax-access/src/idempotency"; +import { + operationFingerprint, + operationIdentity, + runIdempotentOperation, + type IdempotencyStore, +} from "../../packages/siax-access/src/idempotency"; describe("@siax/access universal idempotency", () => { it("binds every result-affecting input into the fingerprint", () => { @@ -18,7 +23,7 @@ describe("@siax/access universal idempotency", () => { }); it("replays a stored receipt verbatim on the exact fingerprint", async () => { const stored = { x: 1 }; - const store: any = { + const store: IdempotencyStore = { start: async () => false, save: async () => {}, receipt: async () => stored, @@ -32,7 +37,7 @@ describe("@siax/access universal idempotency", () => { }); it("claims once and saves only after the dispatch", async () => { const order: string[] = []; - const store: any = { + const store: IdempotencyStore = { start: async () => { order.push("start"); return true; }, save: async () => { order.push("save"); }, receipt: async () => { order.push("receipt"); return undefined; }, @@ -47,7 +52,7 @@ describe("@siax/access universal idempotency", () => { expect(order).toEqual(["start", "dispatch", "save"]); }); it("reports a store error as conflict, never as a fresh start", async () => { - const store: any = { + const store: IdempotencyStore = { start: async () => { throw new Error("db down"); }, save: async () => {}, receipt: async () => { throw new Error("db down"); }, @@ -61,7 +66,7 @@ describe("@siax/access universal idempotency", () => { expect(dispatched).toBe(0); }); it("does not rerun the dispatch when start succeeds but save later fails", async () => { - const store: any = { start: async () => true, save: async () => { throw new Error("journal write failed"); }, receipt: async () => undefined }; + const store: IdempotencyStore = { start: async () => true, save: async () => { throw new Error("journal write failed"); }, receipt: async () => undefined }; let dispatched = 0; const outcome = await runIdempotentOperation({ store, identity: {}, fingerprint: "fp", -- 2.54.0