From 06eed5a4549e050fed09996cec26be2c4c02da4e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 13:25:39 +0100 Subject: [PATCH] test: tighten oauth lock path assertion --- src/agents/auth-profiles/oauth-lock-path.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/agents/auth-profiles/oauth-lock-path.test.ts b/src/agents/auth-profiles/oauth-lock-path.test.ts index b62f98e2d75..d64e87ecdee 100644 --- a/src/agents/auth-profiles/oauth-lock-path.test.ts +++ b/src/agents/auth-profiles/oauth-lock-path.test.ts @@ -6,7 +6,13 @@ import { captureEnv } from "../../test-utils/env.js"; import { resolveOAuthRefreshLockPath } from "./paths.js"; async function expectPathMissing(targetPath: string): Promise { - await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); + try { + await fs.stat(targetPath); + } catch (error) { + expect((error as NodeJS.ErrnoException).code).toBe("ENOENT"); + return; + } + throw new Error(`Expected missing path: ${targetPath}`); } describe("resolveOAuthRefreshLockPath", () => {