mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 15:45:01 +00:00
test: share fast-path mocks for targeted doctor suites
This commit is contained in:
49
src/commands/doctor.fast-path-mocks.ts
Normal file
49
src/commands/doctor.fast-path-mocks.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
vi.mock("./doctor-completion.js", () => ({
|
||||
doctorShellCompletion: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-gateway-daemon-flow.js", () => ({
|
||||
maybeRepairGatewayDaemon: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-gateway-health.js", () => ({
|
||||
checkGatewayHealth: vi.fn().mockResolvedValue({ healthOk: false }),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-memory-search.js", () => ({
|
||||
noteMemorySearchHealth: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-platform-notes.js", () => ({
|
||||
noteDeprecatedLegacyEnvVars: vi.fn(),
|
||||
noteMacLaunchAgentOverrides: vi.fn().mockResolvedValue(undefined),
|
||||
noteMacLaunchctlGatewayEnvOverrides: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-sandbox.js", () => ({
|
||||
maybeRepairSandboxImages: vi.fn(async (cfg: unknown) => cfg),
|
||||
noteSandboxScopeWarnings: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-security.js", () => ({
|
||||
noteSecurityWarnings: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-session-locks.js", () => ({
|
||||
noteSessionLockHealth: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-state-integrity.js", () => ({
|
||||
noteStateIntegrity: vi.fn().mockResolvedValue(undefined),
|
||||
noteWorkspaceBackupTip: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-ui.js", () => ({
|
||||
maybeRepairUiProtocolFreshness: vi.fn().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("./doctor-workspace-status.js", () => ({
|
||||
noteWorkspaceStatus: vi.fn(),
|
||||
}));
|
||||
Reference in New Issue
Block a user