Comparing version 1.0.0 to 1.1.0
@@ -74,2 +74,8 @@ 'use strict'; | ||
/* Stability checking occurs by using an Rx window, | ||
It waits until all of the vals from the resources are >=0, | ||
then it waits for a window which has no changes | ||
(duplicate outputs are filtered by distinctUntilChanged) | ||
*/ | ||
var lastValues = null; | ||
@@ -102,3 +108,3 @@ var src = Rx.Observable.timer(opts.delay, opts.interval) | ||
if (!lastValues) { return false; } | ||
var notReady = Object.keys(lastValues) | ||
var notReady = opts.resources | ||
.filter(function (k) { | ||
@@ -105,0 +111,0 @@ var lastValue = lastValues[k]; |
{ | ||
"name": "wait-on", | ||
"description": "wait-on is a command line utility and Node.js API which will wait for files, ports, sockets, and http(s) resources to become available", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "lib/wait-on", | ||
@@ -6,0 +6,0 @@ "bin": { |
@@ -327,6 +327,37 @@ 'use strict'; | ||
it('should timeout when an http service listening to a socket is too slow', function (done) { | ||
var socketPath; | ||
temp.mkdir({}, function (err, dirPath) { | ||
socketPath = path.resolve(dirPath, 'sock'); | ||
var opts = { | ||
resources: [ | ||
'package.json', | ||
'http://unix:' + socketPath + ':/', | ||
'http://unix:' + socketPath + ':/foo' | ||
], | ||
timeout: 1000, | ||
interval: 100, | ||
window: 100 | ||
}; | ||
httpServer = http.createServer() | ||
.on('request', function (req, res) { | ||
setTimeout(function () { | ||
// res.statusCode = 404; | ||
res.end('data'); | ||
}, 1100); | ||
}); | ||
httpServer.listen(socketPath); | ||
waitOn(opts, function (err) { | ||
expect(err).toExist(); | ||
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
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
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
49878
13
1202
1