mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 04:14:32 +00:00
refactor(test): centralize trigger and cron test helpers
This commit is contained in:
@@ -4,21 +4,10 @@ import { createTempHomeHarness, makeReplyConfig } from "./reply.test-harness.js"
|
||||
|
||||
const runEmbeddedPiAgentMock = vi.fn();
|
||||
|
||||
vi.mock("../agents/model-fallback.js", () => ({
|
||||
runWithModelFallback: async ({
|
||||
provider,
|
||||
model,
|
||||
run,
|
||||
}: {
|
||||
provider: string;
|
||||
model: string;
|
||||
run: (provider: string, model: string) => Promise<unknown>;
|
||||
}) => ({
|
||||
result: await run(provider, model),
|
||||
provider,
|
||||
model,
|
||||
}),
|
||||
}));
|
||||
vi.mock(
|
||||
"../agents/model-fallback.js",
|
||||
async () => await import("../test-utils/model-fallback.mock.js"),
|
||||
);
|
||||
|
||||
vi.mock("../agents/pi-embedded.js", () => ({
|
||||
abortEmbeddedPiRun: vi.fn().mockReturnValue(false),
|
||||
|
||||
Reference in New Issue
Block a user