Files
openclaw/src/plugins/hooks.test-helpers.ts
2026-03-02 16:24:06 +00:00

25 lines
611 B
TypeScript

import type { PluginRegistry } from "./registry.js";
export function createMockPluginRegistry(
hooks: Array<{ hookName: string; handler: (...args: unknown[]) => unknown }>,
): PluginRegistry {
return {
hooks: hooks as never[],
typedHooks: hooks.map((h) => ({
pluginId: "test-plugin",
hookName: h.hookName,
handler: h.handler,
priority: 0,
source: "test",
})),
tools: [],
httpRoutes: [],
channelRegistrations: [],
gatewayHandlers: {},
cliRegistrars: [],
services: [],
providers: [],
commands: [],
} as unknown as PluginRegistry;
}