From db0fdb2925cb71b6981316b08d843cc74ff10f4a Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Sun, 28 Jan 2024 20:59:33 +0100 Subject: [PATCH] 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. --- lib/watcher.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/watcher.js b/lib/watcher.js index d95fbb942..cafd089e0 100644 --- a/lib/watcher.js +++ b/lib/watcher.js @@ -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)); break; }