Skip to content

Commit db0fdb2

Browse files
committed
Fix 'previous failures' in watch mode always incrementing
The counters used absolute paths for the test files, but the clearing logic used relative paths. Count using relative paths instead. The number of previous failures is not observable to the test harness, so this does not come with test coverage. Fixes #3295.
1 parent 735bf41 commit db0fdb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/watcher.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ async function * plan({api, filter, globs, projectDir, providers, stdin, abortSi
106106
case 'uncaught-exception':
107107
case 'unhandled-rejection':
108108
case 'worker-failed': {
109-
failureCounts.set(evt.testFile, 1 + (failureCounts.get(evt.testFile) ?? 0));
109+
const path = nodePath.relative(projectDir, evt.testFile);
110+
failureCounts.set(path, 1 + (failureCounts.get(path) ?? 0));
110111
break;
111112
}
112113

0 commit comments

Comments
 (0)