New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mocha.parallel

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha.parallel - npm Package Compare versions

Comparing version 0.15.0 to 0.15.1

spec/fixtures/syncTime.js

15

lib/parallel.js

@@ -222,4 +222,4 @@ var Promise = require('bluebird');

var start = Date.now();
return createWrapper(fn, spec.ctx)().then(function() {
spec.duration = Date.now() - start;
return createWrapper(fn, spec.ctx)().then(function(duration) {
spec.duration = duration;
});

@@ -287,3 +287,4 @@ },

* Returns a wrapper for a given runnable's fn, including specs or hooks.
* Optionally binds the function handler to the passed context.
* Optionally binds the function handler to the passed context. Resolves
* with the duration of the fn.
*

@@ -297,5 +298,7 @@ * @param {function} fn

return new Promise(function(resolve, reject) {
var start = Date.now();
var cb = function(err) {
if (err) return reject(err);
resolve();
resolve(Date.now() - start);
};

@@ -312,3 +315,5 @@

if (!fn.length || (res && res.then)) {
resolve(res);
Promise.resolve(res).then(function() {
resolve(Date.now() - start);
});
}

@@ -315,0 +320,0 @@ });

{
"name": "mocha.parallel",
"version": "0.15.0",
"version": "0.15.1",
"description": "Run async mocha specs in parallel",

@@ -32,3 +32,6 @@ "main": "lib/parallel.js",

"semaphore": "^1.0.5"
},
"devDependencies": {
"dirmap": "0.0.2"
}
}
var exec = require('child_process').exec;
var assert = require('assert');
var fixtures = require('./fixtures');
var path = require('path');
var dirmap = require('dirmap');
var fixtures = dirmap(path.resolve(__dirname, './fixtures'), true);
var path = require('path');

@@ -270,2 +272,12 @@ describe('parallel', function() {

});
it.only('correctly reports duration for synchronous tests', function(done) {
run(fixtures.syncTime, function(err, stdout, stderr) {
if (err) return done(err);
assert(!stderr.length);
assert.equal(stdout.indexOf('a ('), -1);
done();
});
});
});

@@ -272,0 +284,0 @@

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