Socket
Socket
Sign inDemoInstall

wait-on

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wait-on - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

npm-shrinkwrap.json

8

lib/wait-on.js

@@ -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];

2

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