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", () => {