| 612 | opts.root.harness.watching = true; |
| 613 | |
| 614 | async function restartTestFile(file) { |
| 615 | const runningProcess = runningProcesses.get(file); |
| 616 | if (runningProcess) { |
| 617 | runningProcess.kill(); |
| 618 | await once(runningProcess, 'exit'); |
| 619 | } |
| 620 | if (!runningSubtests.size) { |
| 621 | // Reset the topLevel counter |
| 622 | opts.root.harness.counters.topLevel = 0; |
| 623 | } |
| 624 | |
| 625 | await runningSubtests.get(file); |
| 626 | runningSubtests.set(file, runTestFile(file, filesWatcher, opts)); |
| 627 | } |
| 628 | |
| 629 | // Watch for changes in current filtered files |
| 630 | const onChanged = ({ owners, eventType }) => { |