import { vi } from "vitest"; import type { RuntimeEnv } from "../runtime.js"; import type { MockFn } from "../test-utils/vitest-mock-fn.js"; export const baseConfigSnapshot = { path: "/tmp/openclaw.json", exists: true, raw: "{}", parsed: {}, valid: true, config: {}, issues: [], legacyIssues: [], }; export type TestRuntime = { log: MockFn; error: MockFn; exit: MockFn; }; export function createTestRuntime(): TestRuntime { const log = vi.fn() as MockFn; const error = vi.fn() as MockFn; const exit = vi.fn((_: number) => undefined) as MockFn; return { log, error, exit, }; }