From 4d8e0bcecc9d2b5d7b1910a99ceafec2ecb18426 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 02:49:38 +0100 Subject: [PATCH] test: tighten session lock cleanup assertion --- src/config/sessions.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config/sessions.test.ts b/src/config/sessions.test.ts index ddc6f072dcc..1e06177c799 100644 --- a/src/config/sessions.test.ts +++ b/src/config/sessions.test.ts @@ -104,6 +104,10 @@ describe("sessions", () => { return path.join(canonicalParent, path.basename(filePath)); } + async function expectPathMissing(targetPath: string): Promise { + await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); + } + const deriveSessionKeyCases = [ { name: "returns normalized per-sender key", @@ -799,7 +803,7 @@ describe("sessions", () => { const store = loadSessionStore(storePath); expect(store[mainSessionKey]?.modelOverride).toBe("anthropic/claude-opus-4-6"); expect(store[mainSessionKey]?.thinkingLevel).toBe("high"); - await expect(fs.stat(`${storePath}.lock`)).rejects.toThrow(); + await expectPathMissing(`${storePath}.lock`); }); it("updateSessionStoreEntry re-reads disk inside the writer slot instead of using stale cache", async () => {