Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "watchpack", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "", | ||
@@ -29,5 +29,5 @@ "main": "./lib/watchpack.js", | ||
"async": "^0.9.0", | ||
"chokidar": "^0.8.2", | ||
"chokidar": "^0.10.3", | ||
"graceful-fs": "^3.0.2" | ||
} | ||
} |
@@ -40,2 +40,7 @@ var fs = require("fs"); | ||
TestHelper.prototype.mtime = function mtime(name, mtime) { | ||
var stats = fs.statSync(path.join(this.testdir, name)); | ||
fs.utimesSync(path.join(this.testdir, name), stats.atime, new Date(mtime)); | ||
}; | ||
TestHelper.prototype.remove = function remove(name) { | ||
@@ -42,0 +47,0 @@ rimraf.sync(path.join(this.testdir, name)); |
@@ -13,3 +13,3 @@ var should = require("should"); | ||
afterEach(testHelper.after); | ||
it("should watch a single file", function(done) { | ||
@@ -35,3 +35,3 @@ var w = new Watchpack({ | ||
}); | ||
it("should watch multiple files", function(done) { | ||
@@ -76,3 +76,3 @@ var w = new Watchpack({ | ||
}); | ||
it("should watch a directory", function(done) { | ||
@@ -102,3 +102,3 @@ var w = new Watchpack({ | ||
}); | ||
it("should watch file in a sub directory", function(done) { | ||
@@ -129,2 +129,34 @@ var w = new Watchpack({ | ||
}); | ||
it("should detect a single change to future timestamps", function(done) { | ||
var w = new Watchpack({ | ||
aggregateTimeout: 1000 | ||
}); | ||
var w2 = new Watchpack({ | ||
aggregateTimeout: 1000 | ||
}); | ||
w.on("change", function(file, mtime) { | ||
throw new Error("should not report change event"); | ||
}); | ||
w.on("aggregated", function(changes) { | ||
throw new Error("should not report aggregated event"); | ||
}); | ||
testHelper.file("a"); | ||
testHelper.tick(function() { | ||
w2.watch([path.join(fixtures, "a")], []); | ||
testHelper.tick(function() { | ||
testHelper.mtime("a", Date.now() + 1000000); | ||
testHelper.tick(function() { | ||
w.watch([path.join(fixtures, "a")], []); | ||
testHelper.tick(function() { | ||
testHelper.tick(function() { | ||
w2.close(); | ||
w.close(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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
23708
743
+ Addedasync-each@0.1.6(transitive)
+ Addedchokidar@0.10.9(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedfsevents@0.3.8(transitive)
+ Addedgraceful-fs@2.0.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.1(transitive)
+ Addedlru-cache@2.7.3(transitive)
+ Addedminimatch@0.2.14(transitive)
+ Addednan@2.22.0(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedreaddirp@1.1.0(transitive)
+ Addedsigmund@1.0.1(transitive)
+ Addedstring_decoder@0.10.31(transitive)
- Removedchokidar@0.8.4(transitive)
- Removedrecursive-readdir@0.0.2(transitive)
Updatedchokidar@^0.10.3