Skip to content

Commit

Permalink
Consistent paths in watcher
Browse files Browse the repository at this point in the history
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 ffa62ce
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 55 deletions.
6 changes: 3 additions & 3 deletions lib/watcher.js
Expand Up @@ -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();
}
});
Expand All @@ -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);
});
});
Expand Down Expand Up @@ -215,7 +215,7 @@ class Watcher {
}

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

0 comments on commit ffa62ce

Please sign in to comment.