MCPcopy
hub / github.com/coder/mux / getCapturedEvent

Function getCapturedEvent

src/node/services/streamSimulation.test.ts:34–41  ·  view source on GitHub ↗
(events: CapturedEvent[], type: T["type"])

Source from the content-addressed store, hash-verified

32}
33
34function getCapturedEvent<T extends { type: string }>(events: CapturedEvent[], type: T["type"]): T {
35 const match = events.find((event) => event.event === type);
36 expect(match).toBeDefined();
37 if (!match) {
38 throw new Error(`Expected captured ${type} event`);
39 }
40 return match.data as T;
41}
42
43describe("streamSimulation", () => {
44 test("persists legacy mode metadata for simulated context-limit partials", async () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected