From e69c83d9db38fac8d1e525bdf03a883b551f506d Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Wed, 6 Dec 2017 22:08:49 -0800 Subject: [PATCH] Disable flakey macOS FS events in watcher in the tests --- src/Bundler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Bundler.js b/src/Bundler.js index a6c12cd4865..a65dad44318 100644 --- a/src/Bundler.js +++ b/src/Bundler.js @@ -153,7 +153,12 @@ class Bundler extends EventEmitter { this.farm = WorkerFarm.getShared(this.options); if (this.options.watch) { - this.watcher = new FSWatcher; + // FS events on macOS are flakey in the tests, which write lots of files very quickly + // See https://github.com/paulmillr/chokidar/issues/612 + this.watcher = new FSWatcher({ + useFsEvents: process.env.NODE_ENV !== 'test' + }); + this.watcher.on('change', this.onChange.bind(this)); }