Skip to content

Commit

Permalink
test_runner: add support for eventType change on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarchini committed Aug 16, 2024
1 parent d74731a commit 6e05b5e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,10 @@ function watchFiles(testFiles, opts) {
opts.root.harness.watching = true;
// Watch for changes in current filtered files
watcher.on('changed', ({ owners, eventType }) => {
if (!opts.hasFiles && eventType === 'rename') {
if (!opts.hasFiles && (eventType === 'rename' || eventType === 'change')) {
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 @@ -439,7 +438,6 @@ function watchFiles(testFiles, opts) {
return; // Avoid rerunning files when file deleted
}


testFiles = updatedTestFiles;
}

Expand Down

0 comments on commit 6e05b5e

Please sign in to comment.