MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / connectWebSocket

Function connectWebSocket

services/session-ingest/src/dos/UserConnectionDO.test.ts:130–153  ·  view source on GitHub ↗
(doInstance: UserConnectionDO, connectionId: string)

Source from the content-addressed store, hash-verified

128 result.set(key, value as T);
129 }
130 }
131 return result;
132 }),
133 // The glanceable deferral reads the current alarm before re-arming it, so
134 // the fake must model the alarm rather than return `undefined`.
135 getAlarm: vi.fn(async () => alarmTime),
136 setAlarm: vi.fn(async (scheduledTime: number | Date) => {
137 alarmTime = typeof scheduledTime === 'number' ? scheduledTime : scheduledTime.getTime();
138 }),
139 };
140}
141
142function createMockCtx() {
143 const sockets: MockWS[] = [];
144 const storage = makeStorageFake();
145 return {
146 sockets,
147 storage,
148 addSocket(ws: MockWS) {
149 sockets.push(ws);
150 },
151 removeSocket(ws: MockWS) {
152 const idx = sockets.indexOf(ws);
153 if (idx !== -1) sockets.splice(idx, 1);
154 },
155 build() {
156 return {

Callers 1

Calls 2

createMockWsFunction · 0.85
fetchMethod · 0.65

Tested by

no test coverage detected