23 lines
542 B
TypeScript
23 lines
542 B
TypeScript
|
|
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 ?? [],
|
||
|
|
};
|
||
|
|
};
|