Skip to content

Commit

Permalink
Fix Windows version (#821)
Browse files Browse the repository at this point in the history
* fix(Windows): braces are remove windows path separator.

* chore: Add lost path inside array braces.

* chore: Test without EPERM for Windows.

* chore: Test with event loop ticking.

* test: Make max age bigger.
  • Loading branch information
JSMonk authored and paulmillr committed Apr 16, 2019
1 parent 3323d59 commit 9c575d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,9 @@ _getWatchHelpers(path, depth) {
const getDirParts = (path) => {
if (!hasGlob) return [];
const parts = [];
const expandedPath = braces.expand(path);
const expandedPath = path.includes("{")
? braces.expand(path)
: [path];
expandedPath.forEach((path) => {
parts.push(sysPath.relative(watchPath, path).split(/[\/\\]/));
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"is-binary-path": "^2.0.1",
"is-glob": "^4.0.1",
"normalize-path": "^3.0.0",
"readdirp": "github:paulmillr/readdirp"
"readdirp": "github:JSMonk/readdirp"
},
"optionalDependencies": {
"fsevents": "^2.0.3"
Expand Down
6 changes: 4 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,11 @@ const runTests = function(baseopts) {
resolve();
}
intrvl = setInterval(() => {
if (spies.every(isSpyReady)) finish();
process.nextTick(() => {
if (spies.every(isSpyReady)) finish();
});
}, 20);
timeo = setTimeout(finish, 3500);
timeo = setTimeout(finish, 5000);
});
};

Expand Down

0 comments on commit 9c575d4

Please sign in to comment.