MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / makeBrokerWithBus

Function makeBrokerWithBus

packages/server/test/services.test.ts:523–537  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

521
522describe('ApprovalService (broadcasts + resolve-by-approval_id)', () => {
523 function makeBrokerWithBus(): {
524 broker: ApprovalService;
525 bus: EventService;
526 broadcast: WSBroadcastService;
527 clients: FakeSessionClients;
528 conn: ReturnType<typeof fakeConn>;
529 } {
530 const clients = new FakeSessionClients();
531 const conn = fakeConn('conn_subscriber');
532 clients.subscribe(conn, 'sess_1');
533 const bus = new EventService();
534 const broadcast = new WSBroadcastService(bus, testLogger, clients, new FakeConnectionRegistry(), tmpEnv());
535 const broker = new ApprovalService(testLogger, bus);
536 return { broker, bus, broadcast, clients, conn };
537 }
538
539 function extractApprovalId(sentFrames: unknown[]): string | undefined {
540 for (const frame of sentFrames) {

Callers 1

services.test.tsFile · 0.85

Calls 3

subscribeMethod · 0.95
fakeConnFunction · 0.85
tmpEnvFunction · 0.70

Tested by

no test coverage detected