Comparing version 1.2.0 to 1.3.0
@@ -8,3 +8,6 @@ 'use strict'; | ||
function sane(dir, options) { | ||
if (options.poll) { | ||
if (options.watcher) { | ||
var WatcherClass = require(options.watcher); | ||
return new WatcherClass(dir, options); | ||
} else if (options.poll) { | ||
return new PollWatcher(dir, options); | ||
@@ -11,0 +14,0 @@ } else if (options.watchman) { |
{ | ||
"name": "sane", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Sane aims to be fast, small, and reliable file system watcher.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -75,2 +75,23 @@ var os = require('os'); | ||
describe('sane plugin', function () { | ||
beforeEach(function () { | ||
this.watcher = sane(testdir, { | ||
glob: '**/file_1', | ||
watcher: './test/plugin_watcher', | ||
}); | ||
}); | ||
afterEach(function (done) { | ||
this.watcher.close(done); | ||
}); | ||
it('uses the custom plugin watcher', function (done) { | ||
this.watcher.on('is-test-plugin', function () { | ||
done(); | ||
}); | ||
}); | ||
}); | ||
describe('sane(file)', function() { | ||
@@ -77,0 +98,0 @@ beforeEach(function () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61210
15
1245
6