From 9c575d44e2c8a3c76fde33885c78e955a26118a7 Mon Sep 17 00:00:00 2001 From: Artem Kobzar Date: Tue, 16 Apr 2019 21:49:28 +0300 Subject: [PATCH] Fix Windows version (#821) * 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. --- index.js | 4 +++- package.json | 2 +- test.js | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index aa724fd5..2167b7b1 100644 --- a/index.js +++ b/index.js @@ -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(/[\/\\]/)); }); diff --git a/package.json b/package.json index 884bee9f..e9fddf24 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/test.js b/test.js index 9c813fd3..79dee3fd 100644 --- a/test.js +++ b/test.js @@ -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); }); };