You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

sane

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sane - npm Package Compare versions

Comparing version

to
1.3.0

test/plugin_watcher.js

5

index.js

@@ -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) {

2

package.json
{
"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 () {