Skip to content

Commit

Permalink
Fix 'previous failures' in watch mode always incrementing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
novemberborn committed Jan 28, 2024
1 parent 735bf41 commit 98c63d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/watcher.js
Expand Up @@ -106,7 +106,8 @@ async function * plan({api, filter, globs, projectDir, providers, stdin, abortSi
case 'uncaught-exception':
case 'unhandled-rejection':
case 'worker-failed': {
failureCounts.set(evt.testFile, 1 + (failureCounts.get(evt.testFile) ?? 0));
const path = nodePath.relative(projectDir, evt.testFile);
failureCounts.set(path, 1 + (failureCounts.get(path) ?? 0));

Check warning on line 110 in lib/watcher.js

View check run for this annotation

Codecov / codecov/patch

lib/watcher.js#L109-L110

Added lines #L109 - L110 were not covered by tests
break;
}

Expand Down

0 comments on commit 98c63d9

Please sign in to comment.