Skip to content
Permalink
Browse files

Consistent paths in watcher

Fixes #2040

Change the path handling for watcher, now all internal paths should be absolute and chokidar paths will be converted to absolute before handling.
  • Loading branch information...
bobthekingofegypt authored and novemberborn committed Aug 11, 2019
1 parent b27cb8d commit ffa62ce94dec43f18a0c66623fa604036ef8dc48
Showing with 141 additions and 55 deletions.
  1. +3 −3 lib/watcher.js
  2. +138 −52 test/watcher.js
@@ -162,7 +162,7 @@ class Watcher {
}).on('all', (event, path) => {
if (event === 'add' || event === 'change' || event === 'unlink') {
debug('Detected %s of %s', event, path);
this.dirtyStates[path] = event;
this.dirtyStates[nodePath.join(this.globs.cwd, path)] = event;
this.debouncer.debounce();
}
});
@@ -180,7 +180,7 @@ class Watcher {
const dependencies = evt.dependencies.map(x => relative(x)).filter(filePath => {
const {isHelper, isSource} = globs.classify(filePath, this.globs);
return isHelper || isSource;
});
}).map(x => nodePath.join(this.globs.cwd, x));
this.updateTestDependencies(evt.testFile, dependencies);
});
});
@@ -215,7 +215,7 @@ class Watcher {
}

for (const file of evt.files) {
this.touchedFiles.add(nodePath.relative(process.cwd(), file));
this.touchedFiles.add(file);
}
});
});

0 comments on commit ffa62ce

Please sign in to comment.
You can’t perform that action at this time.