Skip to content

Commit d74731a

Browse files
committed
test_runner: prevent rerunning deleted files
1 parent bdc8e22 commit d74731a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/internal/test_runner/runner.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ function watchFiles(testFiles, opts) {
427427
const updatedTestFiles = createTestFileList(opts.globPatterns);
428428

429429
const newFileName = ArrayPrototypeFind(updatedTestFiles, (x) => !ArrayPrototypeIncludes(testFiles, x));
430+
const previousFileName = ArrayPrototypeFind(testFiles, (x) => !ArrayPrototypeIncludes(updatedTestFiles, x));
430431

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

442+
443+
testFiles = updatedTestFiles;
441444
}
442445

443446
watcher.unfilterFilesOwnedBy(owners);

0 commit comments

Comments
 (0)