From 4d25ce0605a8cfc6f1d3380da6088092e797d075 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Thu, 16 Jul 2026 00:57:10 -0700 Subject: [PATCH] refactor(agents): share OAuth file-lock mock factory (#108745) --- .../oauth-file-lock-passthrough.test-support.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/agents/auth-profiles/oauth-file-lock-passthrough.test-support.ts b/src/agents/auth-profiles/oauth-file-lock-passthrough.test-support.ts index 12da0bcfe6b4..b0d298f726d1 100644 --- a/src/agents/auth-profiles/oauth-file-lock-passthrough.test-support.ts +++ b/src/agents/auth-profiles/oauth-file-lock-passthrough.test-support.ts @@ -5,17 +5,14 @@ */ import { afterAll, vi } from "vitest"; -vi.mock("../../infra/file-lock.js", () => ({ +const fileLockPassthroughMock = vi.hoisted(() => ({ drainFileLockStateForTest: async () => undefined, resetFileLockStateForTest: () => undefined, withFileLock: async (_filePath: string, _options: unknown, run: () => Promise) => run(), })); -vi.mock("../../plugin-sdk/file-lock.js", () => ({ - drainFileLockStateForTest: async () => undefined, - resetFileLockStateForTest: () => undefined, - withFileLock: async (_filePath: string, _options: unknown, run: () => Promise) => run(), -})); +vi.mock("../../infra/file-lock.js", () => fileLockPassthroughMock); +vi.mock("../../plugin-sdk/file-lock.js", () => fileLockPassthroughMock); afterAll(() => { vi.doUnmock("../../infra/file-lock.js");