Skip to content

Commit 2bfc91b

Browse files
committed
remove fsevents
1 parent dedc549 commit 2bfc91b

File tree

3 files changed

+12
-132
lines changed

3 files changed

+12
-132
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const NodeWatcher = require('./src/node_watcher');
44
const PollWatcher = require('./src/poll_watcher');
55
const WatchmanWatcher = require('./src/watchman_watcher');
66
const WatchexecWatcher = require('./src/watchexec_watcher');
7-
const FSEventsWatcher = require('./src/fsevents_watcher');
87

98
function sane(dir, options) {
109
options = options || {};
@@ -18,7 +17,7 @@ function sane(dir, options) {
1817
} else if (options.watchexec) {
1918
return new WatchexecWatcher(dir, options);
2019
} else if (options.fsevents) {
21-
return new FSEventsWatcher(dir, options);
20+
throw new Error('Sane >= 4 no longer support the fsevents module.');
2221
} else {
2322
return new NodeWatcher(dir, options);
2423
}
@@ -29,4 +28,9 @@ sane.NodeWatcher = NodeWatcher;
2928
sane.PollWatcher = PollWatcher;
3029
sane.WatchmanWatcher = WatchmanWatcher;
3130
sane.WatchexecWatcher = WatchexecWatcher;
32-
sane.FSEventsWatcher = FSEventsWatcher;
31+
32+
Object.defineProperty(sane, 'FSEventsWatcher', {
33+
get() {
34+
throw new Error('Sane >= 4 no longer support the fsevents module.');
35+
},
36+
});

src/fsevents_watcher.js

Lines changed: 0 additions & 122 deletions
This file was deleted.

test/test.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ var rimraf = require('rimraf');
77
var path = require('path');
88
var assert = require('assert');
99
var tmp = require('tmp');
10-
var os = require('os');
1110

1211
tmp.setGracefulCleanup();
1312
var jo = path.join.bind(path);
@@ -19,11 +18,12 @@ describe('sane in node mode', function() {
1918
harness.call(this, {});
2019
});
2120

22-
if (os.platform() === 'darwin') {
23-
describe('sane in fsevents mode', function() {
24-
harness.call(this, { fsevents: true });
21+
describe('sane in fsevents mode', function() {
22+
it('errors in a helpful manner', function() {
23+
assert.throws(() => sane.FSEventsWatcher, 'asdf');
24+
assert.throws(() => sane('/dev/null', { fsevents: true }), 'asdf');
2525
});
26-
}
26+
});
2727

2828
describe('sane in watchman mode', function() {
2929
harness.call(this, { watchman: true });
@@ -43,8 +43,6 @@ function getWatcherClass(mode) {
4343
return sane.WatchexecWatcher;
4444
} else if (mode.poll) {
4545
return sane.PollWatcher;
46-
} else if (mode.fsevents) {
47-
return sane.FSEventsWatcher;
4846
} else {
4947
return sane.NodeWatcher;
5048
}

0 commit comments

Comments
 (0)