alltheversions
Advanced tools
Comparing version 1.0.6 to 2.0.0
@@ -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)) { |
@@ -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", |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
20123
12
608
7
3
+ Addedbabel@^5.8.23
+ Addedacorn@5.7.4(transitive)
+ Addedalign-text@0.1.4(transitive)
+ Addedalter@0.2.0(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedanymatch@1.3.2(transitive)
+ Addedarr-diff@2.0.04.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-unique@0.2.10.3.2(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedast-traverse@0.1.1(transitive)
+ Addedast-types@0.8.120.9.6(transitive)
+ Addedasync-each@1.0.6(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbabel@5.8.38(transitive)
+ Addedbabel-core@5.8.38(transitive)
+ Addedbabel-plugin-constant-folding@1.0.1(transitive)
+ Addedbabel-plugin-dead-code-elimination@1.0.2(transitive)
+ Addedbabel-plugin-eval@1.0.1(transitive)
+ Addedbabel-plugin-inline-environment-variables@1.0.1(transitive)
+ Addedbabel-plugin-jscript@1.0.4(transitive)
+ Addedbabel-plugin-member-expression-literals@1.0.1(transitive)
+ Addedbabel-plugin-property-literals@1.0.1(transitive)
+ Addedbabel-plugin-proto-to-assign@1.0.4(transitive)
+ Addedbabel-plugin-react-constant-elements@1.0.3(transitive)
+ Addedbabel-plugin-react-display-name@1.0.3(transitive)
+ Addedbabel-plugin-remove-console@1.0.1(transitive)
+ Addedbabel-plugin-remove-debugger@1.0.1(transitive)
+ Addedbabel-plugin-runtime@1.0.7(transitive)
+ Addedbabel-plugin-undeclared-variables-check@1.0.2(transitive)
+ Addedbabel-plugin-undefined-to-void@1.1.6(transitive)
+ Addedbabylon@5.8.38(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbinary-extensions@1.13.1(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedbraces@1.8.52.3.2(transitive)
+ Addedbreakable@1.0.0(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedcamelcase@1.2.1(transitive)
+ Addedcenter-align@0.1.3(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedchokidar@1.7.0(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcliui@2.1.0(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedcommoner@0.10.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcore-js@1.2.7(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddefs@1.1.1(transitive)
+ Addeddetect-indent@3.0.1(transitive)
+ Addeddetective@4.7.1(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedesprima@2.7.33.1.3(transitive)
+ Addedesprima-fb@15001.1001.0-dev-harmony-fb(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedexpand-brackets@0.1.52.1.4(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextend-shallow@2.0.13.0.2(transitive)
+ Addedextglob@0.3.22.0.4(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.44.0.0(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfs-readdir-recursive@0.1.2(transitive)
+ Addedfsevents@1.2.13(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedglob@5.0.15(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedglobals@6.4.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhome-or-tmp@1.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinvert-kv@1.0.0(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-binary-path@1.0.1(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-core-module@2.16.1(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-integer@1.0.7(transitive)
+ Addedis-number@2.1.03.0.04.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedjs-tokens@1.0.1(transitive)
+ Addedjsesc@0.5.0(transitive)
+ Addedjson5@0.4.0(transitive)
+ Addedkind-of@3.2.24.0.06.0.3(transitive)
+ Addedlazy-cache@1.0.4(transitive)
+ Addedlcid@1.0.0(transitive)
+ Addedleven@1.0.2(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedlongest@1.0.1(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.113.1.10(transitive)
+ Addedminimatch@2.0.10(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addednan@2.22.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedos-locale@1.4.0(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedoutput-file-sync@1.1.2(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedpath-exists@1.0.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedq@1.5.1(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedreaddirp@2.2.1(transitive)
+ Addedrecast@0.10.330.11.23(transitive)
+ Addedregenerate@1.4.2(transitive)
+ Addedregenerator@0.8.40(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedregexpu@1.3.0(transitive)
+ Addedregjsgen@0.2.0(transitive)
+ Addedregjsparser@0.1.5(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedresolve@1.22.10(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedright-align@0.1.3(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsimple-fmt@0.1.0(transitive)
+ Addedsimple-is@0.2.0(transitive)
+ Addedslash@1.0.0(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsource-map@0.1.320.5.7(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-support@0.2.10(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedstable@0.1.8(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstringmap@0.2.2(transitive)
+ Addedstringset@0.2.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedto-fast-properties@1.0.3(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.1(transitive)
+ Addedtrim-right@1.0.1(transitive)
+ Addedtry-resolve@1.0.1(transitive)
+ Addedtryor@0.1.2(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedurix@0.1.0(transitive)
+ Addeduse@3.1.1(transitive)
+ Addeduser-home@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwindow-size@0.1.4(transitive)
+ Addedwordwrap@0.0.2(transitive)
+ Addedy18n@3.2.2(transitive)
+ Addedyargs@3.27.0(transitive)