test: add explicit harness mock types

This commit is contained in:
Gustavo Madeira Santana
2026-02-14 16:46:06 -05:00
parent 123ae82fca
commit f94c06c53f
4 changed files with 63 additions and 22 deletions

View File

@@ -256,7 +256,12 @@ vi.mock("./doctor-state-migrations.js", () => ({
runLegacyStateMigrations,
}));
export async function arrangeLegacyStateMigrationTest() {
export async function arrangeLegacyStateMigrationTest(): Promise<{
doctorCommand: unknown;
runtime: { log: MockFn; error: MockFn; exit: MockFn };
detectLegacyStateMigrations: MockFn;
runLegacyStateMigrations: MockFn;
}> {
readConfigFileSnapshot.mockResolvedValue({
path: "/tmp/openclaw.json",
exists: true,
@@ -270,9 +275,9 @@ export async function arrangeLegacyStateMigrationTest() {
const { doctorCommand } = await import("./doctor.js");
const runtime = {
log: vi.fn(),
error: vi.fn(),
exit: vi.fn(),
log: vi.fn() as unknown as MockFn,
error: vi.fn() as unknown as MockFn,
exit: vi.fn() as unknown as MockFn,
};
detectLegacyStateMigrations.mockClear();