Grow `file` every 100ms for `forMs`.
(file: string, forMs: number)
| 105 | |
| 106 | /** Grow `file` every 100ms for `forMs`. */ |
| 107 | function growFile(file: string, forMs: number): Promise<void> { |
| 108 | return new Promise((resolve) => { |
| 109 | const iv = setInterval(() => { fs.appendFileSync(file, 'x'.repeat(64)); }, 100); |
| 110 | setTimeout(() => { clearInterval(iv); resolve(); }, forMs); |
| 111 | }); |
| 112 | } |
| 113 | |
| 114 | /** Spawned-process source: block the main thread for `ms`, then exit(5). */ |
| 115 | const block = (ms: number): string => ` |
no test coverage detected