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

Function waitForMarker

__tests__/cli-ui-command.test.ts:243–250  ·  view source on GitHub ↗

The opener is async (detached); give it a moment before concluding.

(timeoutMs: number)

Source from the content-addressed store, hash-verified

241
242 /** The opener is async (detached); give it a moment before concluding. */
243 async function waitForMarker(timeoutMs: number): Promise<string | null> {
244 const deadline = Date.now() + timeoutMs;
245 for (;;) {
246 if (fs.existsSync(markerFile())) return fs.readFileSync(markerFile(), 'utf-8');
247 if (Date.now() > deadline) return null;
248 await new Promise((r) => setTimeout(r, 50));
249 }
250 }
251
252 it('serves the viewer and prints where it is', async () => {
253 const viewer = await startViewer(['--no-open', '--port', '0', projectDir], {});

Callers 1

Calls 1

markerFileFunction · 0.85

Tested by

no test coverage detected