Skip to content

Commit

Permalink
test_runner: prevent rerunning deleted files
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarchini committed Aug 16, 2024
1 parent bdc8e22 commit d74731a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ function watchFiles(testFiles, opts) {
const updatedTestFiles = createTestFileList(opts.globPatterns);

const newFileName = ArrayPrototypeFind(updatedTestFiles, (x) => !ArrayPrototypeIncludes(testFiles, x));
const previousFileName = ArrayPrototypeFind(testFiles, (x) => !ArrayPrototypeIncludes(updatedTestFiles, x));

// When file renamed (created / deleted) we need to update the watcher
if (newFileName) {
Expand All @@ -438,6 +439,8 @@ function watchFiles(testFiles, opts) {
return; // Avoid rerunning files when file deleted
}


testFiles = updatedTestFiles;
}

watcher.unfilterFilesOwnedBy(owners);
Expand Down

0 comments on commit d74731a

Please sign in to comment.