From 3112fbcb4d2ef3ad8c17a87589dcb4dbb2f0ed07 Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 10:36:35 +0100 Subject: [PATCH] test: tighten diffs store cleanup assertion --- extensions/diffs/src/store.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/diffs/src/store.test.ts b/extensions/diffs/src/store.test.ts index 7cf53887c5e..822341a0d54 100644 --- a/extensions/diffs/src/store.test.ts +++ b/extensions/diffs/src/store.test.ts @@ -141,9 +141,12 @@ describe("DiffArtifactStore", () => { vi.setSystemTime(new Date(now.getTime() + 2_000)); await store.cleanupExpired(); - await expect(fs.stat(path.dirname(standalone.filePath))).rejects.toMatchObject({ - code: "ENOENT", - }); + const error = await fs.stat(path.dirname(standalone.filePath)).then( + () => undefined, + (statError: unknown) => statError, + ); + expect(error).toBeInstanceOf(Error); + expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); }); it("supports image path aliases for backward compatibility", async () => {