Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

watchpack

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

watchpack - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

package.json
{
"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();
});
});
});
});
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc