mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:30:42 +00:00
test: hoist backup archive mocks
This commit is contained in:
@@ -5,15 +5,19 @@ import type { RuntimeEnv } from "../runtime.js";
|
||||
import * as backupShared from "./backup-shared.js";
|
||||
import { resolveBackupPlanFromPaths } from "./backup-shared.js";
|
||||
|
||||
export const tarCreateMock = vi.fn();
|
||||
export const backupVerifyCommandMock = vi.fn();
|
||||
const backupTestMocks = vi.hoisted(() => ({
|
||||
backupVerifyCommandMock: vi.fn(),
|
||||
tarCreateMock: vi.fn(),
|
||||
}));
|
||||
|
||||
export const { backupVerifyCommandMock, tarCreateMock } = backupTestMocks;
|
||||
|
||||
vi.mock("tar", () => ({
|
||||
c: tarCreateMock,
|
||||
c: backupTestMocks.tarCreateMock,
|
||||
}));
|
||||
|
||||
vi.mock("./backup-verify.js", () => ({
|
||||
backupVerifyCommand: backupVerifyCommandMock,
|
||||
backupVerifyCommand: backupTestMocks.backupVerifyCommandMock,
|
||||
}));
|
||||
|
||||
export function createBackupTestRuntime(): RuntimeEnv {
|
||||
|
||||
Reference in New Issue
Block a user