()
| 245 | * Call this in afterEach BEFORE rmSync to avoid async-ENOENT-after-teardown. |
| 246 | */ |
| 247 | export async function _clearOutputsForTest(): Promise<void> { |
| 248 | for (const output of outputs.values()) { |
| 249 | output.cancel() |
| 250 | } |
| 251 | while (_pendingOps.size > 0) { |
| 252 | await Promise.allSettled([..._pendingOps]) |
| 253 | } |
| 254 | outputs.clear() |
| 255 | } |
| 256 | |
| 257 | function getOrCreateOutput(taskId: string): DiskTaskOutput { |
| 258 | let output = outputs.get(taskId) |