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

Function makeQuestionBroker

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

Source from the content-addressed store, hash-verified

617
618describe('QuestionService (broadcasts + dismiss)', () => {
619 function makeQuestionBroker(): {
620 broker: QuestionService;
621 bus: EventService;
622 broadcast: WSBroadcastService;
623 clients: FakeSessionClients;
624 conn: ReturnType<typeof fakeConn>;
625 } {
626 const clients = new FakeSessionClients();
627 const conn = fakeConn('conn_q_subscriber');
628 clients.subscribe(conn, 's');
629 const bus = new EventService();
630 const broadcast = new WSBroadcastService(bus, testLogger, clients, new FakeConnectionRegistry(), tmpEnv());
631 const broker = new QuestionService(testLogger, bus);
632 return { broker, bus, broadcast, clients, conn };
633 }
634
635 function extractQuestionId(sentFrames: unknown[]): string | undefined {
636 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