(dir: string)
| 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; |
no test coverage detected