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

alltheversions

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alltheversions - npm Package Compare versions

Comparing version 1.0.6 to 2.0.0

dist/granularity.js

115

dist/index.js

@@ -9,2 +9,8 @@ "use strict";

var _granularity = require("./granularity");
var major = _granularity.major;
var minor = _granularity.minor;
var patch = _granularity.patch;
var rimraf = _interopRequire(require("rimraf-promise"));

@@ -18,2 +24,4 @@

var assert = _interopRequire(require("assert"));
var semver = _interopRequire(require("semver"));

@@ -23,2 +31,4 @@

var fs = _interopRequire(require("fs"));
var Module = (function () {

@@ -36,4 +46,3 @@

this.name = mod.name;
this.task = mod.task || "npm test";
this.timeout = mod.timeout || 1000 * 10;
this.task = makePromise(mod.task || "npm test", mod.timeout || 1000 * 10);
}

@@ -60,2 +69,48 @@

},
move: {
//
// Move existing module folder temporarily
//
value: (function (_move) {
var _moveWrapper = function move() {
return _move.apply(this, arguments);
};
_moveWrapper.toString = function () {
return _move.toString();
};
return _moveWrapper;
})(function () {
var _this = this;
this.emit("before-move", this);
return move("node_modules/" + this.name, "node_modules/" + this.name + ".moved").then(function (res) {
_this.emit("after-move", _this, res);
return _this;
}, function () {
return _this;
});
})
},
restore: {
//
// Restore temporarily moved module folder
//
value: function restore() {
var _this = this;
this.emit("before-restore", this);
return move("node_modules/" + this.name + ".moved", "node_modules/" + this.name).then(function (res) {
_this.emit("after-restore", _this, res);
return _this;
}, function () {
return _this;
});
}
},
uninstall: {

@@ -107,3 +162,3 @@

var p = exec(this.task, this.timeout);
var p = this.task();
this.emit("test", this, p);

@@ -126,3 +181,3 @@ return p.then(function (res) {

//
// Serially run the uninstall -> install -> test flow
// Serially run the test flow
//

@@ -133,6 +188,10 @@

return this.uninstall().then(function () {
return this.move().then(function () {
return _this.install();
}).then(function () {
return _this.test();
}).then(function () {
return _this.uninstall();
}).then(function () {
return _this.restore();
});

@@ -158,2 +217,19 @@ }

// Support adjustable granularity
if (mod.filter) {
switch (mod.filter) {
case "major":
list = major(list);break;
case "minor":
list = minor(list);break;
case "patch":
list = patch(list);break;
default:
if (typeof mod.filter === "function") {
list = mod.filter(list);
}
break;
}
}
return list.map(function (version) {

@@ -201,2 +277,31 @@ return new Module(mod, version, emitter);

//
function move(before, after) {
return new Promise(function (pass, fail) {
fs.rename(before, after, callbackify(pass, fail));
});
}
function makePromise(task, timeout) {
assert(typeof task === "string" || typeof task === "function");
if (typeof task === "string") {
return function () {
return exec(task, timeout);
};
}return function () {
return promisify(task);
};
}
function callbackify(pass, fail) {
return function (err, res) {
err ? fail(err) : pass(res);
};
}
function promisify(fn) {
return new Promise(function (pass, fail) {
fn.length ? fn(callbackify(pass, fail)) : pass(fn());
});
}
function satisfies(version, ranges) {

@@ -203,0 +308,0 @@ if (!Array.isArray(ranges)) {

2

dist/reporters/spec.js

@@ -39,3 +39,3 @@ "use strict";

ev.on("test", function (mod, p) {
if (opt.verbose) {
if (opt.verbose && p.stdout && p.stderr) {
p.stdout.pipe(indentStream(4)).pipe(opt.out);

@@ -42,0 +42,0 @@ p.stderr.pipe(indentStream(4)).pipe(opt.err);

@@ -0,1 +1,2 @@

require('babel/register')
var gulp = require('gulp')

@@ -2,0 +3,0 @@ var babel = require('gulp-babel')

{
"name": "alltheversions",
"version": "1.0.6",
"version": "2.0.0",
"description": "Run your tests against ALL THE VERSIONS!",

@@ -17,2 +17,3 @@ "author": "Stephen Belanger <admin@stephenbelanger.com>",

"dependencies": {
"babel": "^5.8.23",
"bluebird": "~2.9.14",

@@ -19,0 +20,0 @@ "indent-string": "~1.2.1",

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