Spaces:
Building
Building
File size: 670 Bytes
fb4d8fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | import type { PluginRegistry } from "../../../plugins/registry.js";
export const createTestRegistry = (overrides: Partial<PluginRegistry> = {}): PluginRegistry => {
const base: PluginRegistry = {
plugins: [],
tools: [],
hooks: [],
typedHooks: [],
channels: [],
providers: [],
gatewayHandlers: {},
httpHandlers: [],
httpRoutes: [],
cliRegistrars: [],
services: [],
commands: [],
diagnostics: [],
};
const merged = { ...base, ...overrides };
return {
...merged,
gatewayHandlers: merged.gatewayHandlers ?? {},
httpHandlers: merged.httpHandlers ?? [],
httpRoutes: merged.httpRoutes ?? [],
};
};
|