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

Function done

packages/server/test/ws-auth.e2e.test.ts:187–197  ·  view source on GitHub ↗
(err?: Error)

Source from the content-addressed store, hash-verified

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

Callers 5

expectRejectedFunction · 0.70
validateBodyFunction · 0.50
validateQueryFunction · 0.50
validateParamsFunction · 0.50
startVisServerFunction · 0.50

Calls 2

rejectFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected