mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 05:14:09 +02:00
20 lines
665 B
TypeScript
20 lines
665 B
TypeScript
import { vi } from "vitest";
|
|
import type { GatewayService } from "./service.js";
|
|
|
|
export function createMockGatewayService(overrides: Partial<GatewayService> = {}): GatewayService {
|
|
return {
|
|
label: "LaunchAgent",
|
|
loadedText: "loaded",
|
|
notLoadedText: "not loaded",
|
|
stage: vi.fn(async () => {}),
|
|
install: vi.fn(async () => {}),
|
|
uninstall: vi.fn(async () => {}),
|
|
stop: vi.fn(async () => {}),
|
|
restart: vi.fn(async () => ({ outcome: "completed" as const })),
|
|
isLoaded: vi.fn(async () => false),
|
|
readCommand: vi.fn(async () => null),
|
|
readRuntime: vi.fn(async () => ({ status: "stopped" as const })),
|
|
...overrides,
|
|
};
|
|
}
|