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

Function untilLive

__tests__/watcher.test.ts:1270–1278  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

1268 // restart. Poke a probe under `dir` until the watcher reports it, so the
1269 // edit under test is made once, against a stream known to be live.
1270 const untilLive = (dir: string) => {
1271 const probe = path.join(dir, 'watch-probe.ts');
1272 const rel = path.relative(testDir, probe).replace(/\\/g, '/');
1273 return waitFor(() => {
1274 if (cg!.getPendingFiles().some(p => p.path === rel)) return true;
1275 fs.writeFileSync(probe, `// ${Date.now()}\n`);
1276 return false;
1277 }, 8000);
1278 };
1279
1280 afterEach(() => {
1281 cg = undefined;

Callers 1

watcher.test.tsFile · 0.85

Calls 3

waitForFunction · 0.70
joinMethod · 0.45
getPendingFilesMethod · 0.45

Tested by

no test coverage detected