refactor(test): share gateway e2e registry helper

This commit is contained in:
Peter Steinberger
2026-02-15 21:41:18 +00:00
parent 84601bf96b
commit c3812a1ffb
5 changed files with 21 additions and 55 deletions

View File

@@ -5,6 +5,7 @@ import { afterAll, beforeAll, describe, expect, test, vi } from "vitest";
import type { ChannelPlugin } from "../channels/plugins/types.js";
import type { PluginRegistry } from "../plugins/registry.js";
import { setRegistry } from "./server.agent.gateway-server-agent.mocks.js";
import { createRegistry } from "./server.e2e-registry-helpers.js";
import {
agentCommand,
connectOk,
@@ -42,19 +43,6 @@ function expectChannels(call: Record<string, unknown>, channel: string) {
expect(runContext?.messageChannel).toBe(channel);
}
const createRegistry = (channels: PluginRegistry["channels"]): PluginRegistry => ({
plugins: [],
tools: [],
channels,
providers: [],
gatewayHandlers: {},
httpHandlers: [],
httpRoutes: [],
cliRegistrars: [],
services: [],
diagnostics: [],
});
const createStubChannelPlugin = (params: {
id: ChannelPlugin["id"];
label: string;