mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-25 13:41:13 +00:00
refactor(agents): share OAuth file-lock mock factory (#108745)
This commit is contained in:
committed by
GitHub
parent
e36f586325
commit
4d25ce0605
@@ -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 <T>(_filePath: string, _options: unknown, run: () => Promise<T>) => run(),
|
||||
}));
|
||||
|
||||
vi.mock("../../plugin-sdk/file-lock.js", () => ({
|
||||
drainFileLockStateForTest: async () => undefined,
|
||||
resetFileLockStateForTest: () => undefined,
|
||||
withFileLock: async <T>(_filePath: string, _options: unknown, run: () => Promise<T>) => run(),
|
||||
}));
|
||||
vi.mock("../../infra/file-lock.js", () => fileLockPassthroughMock);
|
||||
vi.mock("../../plugin-sdk/file-lock.js", () => fileLockPassthroughMock);
|
||||
|
||||
afterAll(() => {
|
||||
vi.doUnmock("../../infra/file-lock.js");
|
||||
|
||||
Reference in New Issue
Block a user