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

Function done

packages/server/test/host-origin.e2e.test.ts:185–195  ·  view source on GitHub ↗
(err?: Error)

Source from the content-addressed store, hash-verified

183 return new Promise((resolve, reject) => {
184 const ws = new WebSocket(url, opts?.protocols, { headers: opts?.headers });
185 const done = (err?: Error): void => {
186 clearTimeout(t);
187 ws.removeAllListeners();
188 try {
189 ws.terminate();
190 } catch {
191 // ignore
192 }
193 if (err !== undefined) reject(err);
194 else resolve();
195 };
196 const t = setTimeout(
197 () => done(new Error('connection was not rejected within timeout')),
198 1500,

Callers 1

expectRejectedFunction · 0.70

Calls 2

rejectFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected