From 57cea14c0117a970394fea2fec3f7cdd442ce186 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 3 Jan 2019 12:03:48 -0800 Subject: [PATCH] CLI: Update node-watch to 0.6.0 * Added 'ready' event. * Improved Linux support for recursive watching (changes from new directories during the debounce are now reported as well). * Fixed various bugs. --- package.json | 2 +- src/cli/run.js | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 1d4c3d889..42b7e34ed 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "commander": "2.12.2", "js-reporters": "1.2.1", "resolve": "1.5.0", - "node-watch": "0.5.9", + "node-watch": "0.6.0", "minimatch": "3.0.4" }, "devDependencies": { diff --git a/src/cli/run.js b/src/cli/run.js index e597a1a6f..fcda91da9 100644 --- a/src/cli/run.js +++ b/src/cli/run.js @@ -159,6 +159,10 @@ run.watch = function watch() { run.restart( args ); } ); + watcher.on( "ready", () => { + run.apply( null, args ); + } ); + function stop() { console.log( "Stopping QUnit..." ); @@ -170,12 +174,6 @@ run.watch = function watch() { process.on( "SIGTERM", stop ); process.on( "SIGINT", stop ); - - // initial run must be delayed by at least 200ms - // https://github.com/yuanchuan/node-watch/issues/71 - setTimeout( () => { - run.apply( null, args ); - }, 210 ); }; module.exports = run;