mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 02:40:20 +00:00
chore: widen hook-runner test mock signatures for tsgo
This commit is contained in:
@@ -1,10 +1,31 @@
|
||||
import { vi } from "vitest";
|
||||
import type {
|
||||
PluginHookAgentContext,
|
||||
PluginHookBeforeAgentStartResult,
|
||||
PluginHookBeforeModelResolveResult,
|
||||
PluginHookBeforePromptBuildResult,
|
||||
} from "../../plugins/types.js";
|
||||
|
||||
export const mockedGlobalHookRunner = {
|
||||
hasHooks: vi.fn(() => false),
|
||||
runBeforeAgentStart: vi.fn(async () => undefined),
|
||||
runBeforePromptBuild: vi.fn(async () => undefined),
|
||||
runBeforeModelResolve: vi.fn(async () => undefined),
|
||||
hasHooks: vi.fn((_hookName: string) => false),
|
||||
runBeforeAgentStart: vi.fn(
|
||||
async (
|
||||
_event: { prompt: string; messages?: unknown[] },
|
||||
_ctx: PluginHookAgentContext,
|
||||
): Promise<PluginHookBeforeAgentStartResult | undefined> => undefined,
|
||||
),
|
||||
runBeforePromptBuild: vi.fn(
|
||||
async (
|
||||
_event: { prompt: string; messages: unknown[] },
|
||||
_ctx: PluginHookAgentContext,
|
||||
): Promise<PluginHookBeforePromptBuildResult | undefined> => undefined,
|
||||
),
|
||||
runBeforeModelResolve: vi.fn(
|
||||
async (
|
||||
_event: { prompt: string },
|
||||
_ctx: PluginHookAgentContext,
|
||||
): Promise<PluginHookBeforeModelResolveResult | undefined> => undefined,
|
||||
),
|
||||
};
|
||||
|
||||
vi.mock("../../plugins/hook-runner-global.js", () => ({
|
||||
|
||||
Reference in New Issue
Block a user