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