From ccaf4a03fc9fa58eb97246469bcca10ea5ccb400 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 12:04:22 +0100 Subject: [PATCH] test: tighten trajectory cleanup path assertions --- src/trajectory/cleanup.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/trajectory/cleanup.test.ts b/src/trajectory/cleanup.test.ts index 0ad72c9844f..d466e1a9abd 100644 --- a/src/trajectory/cleanup.test.ts +++ b/src/trajectory/cleanup.test.ts @@ -32,7 +32,13 @@ function pointerFile(sessionId: string, runtimeFile: string): string { } async function expectPathMissing(targetPath: string): Promise { - await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); + let statError: unknown; + try { + await fs.stat(targetPath); + } catch (error) { + statError = error; + } + expect((statError as NodeJS.ErrnoException | undefined)?.code).toBe("ENOENT"); } describe("trajectory cleanup", () => {