MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / tick

Function tick

__tests__/mcp-daemon.test.ts:136–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134 return new Promise((resolve, reject) => {
135 const started = Date.now();
136 const tick = () => {
137 let v: T | undefined | null | false;
138 try { v = predicate(); } catch (e) { return reject(e); }
139 if (v) return resolve(v as T);
140 if (Date.now() - started > timeoutMs) {
141 // Name the wait: an async stack loses the await site, so an unlabeled
142 // timeout can't tell WHICH step flaked (the #662 test's recurring
143 // timeout was undiagnosable for exactly this reason).
144 return reject(new Error(`Timed out after ${timeoutMs}ms${label ? ` waiting for: ${label}` : ''}`));
145 }
146 setTimeout(tick, pollMs);
147 };
148 tick();
149 });
150}

Callers 1

waitForFunction · 0.70

Calls 1

resolveFunction · 0.70

Tested by

no test coverage detected