23 lines
542 B
TypeScript
Raw Normal View History

import type { PluginRegistry } from "../../../plugins/registry.js";
export const createTestRegistry = (
overrides: Partial<PluginRegistry> = {},
): PluginRegistry => {
const base: PluginRegistry = {
plugins: [],
tools: [],
channels: [],
gatewayHandlers: {},
httpHandlers: [],
cliRegistrars: [],
services: [],
diagnostics: [],
};
const merged = { ...base, ...overrides };
return {
...merged,
gatewayHandlers: merged.gatewayHandlers ?? {},
httpHandlers: merged.httpHandlers ?? [],
};
};