alltheversions
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -59,3 +59,5 @@ #!/usr/bin/env node | ||
try { | ||
reporter = require("./reporters/" + argv.reporter)(argv); | ||
reporter = require("./reporters/" + argv.reporter)({ | ||
verbose: argv.verbose | ||
}); | ||
} catch (e) { | ||
@@ -62,0 +64,0 @@ console.error("Unknown reporter \"" + argv.reporter + "\""); |
@@ -11,3 +11,5 @@ "use strict"; | ||
module.exports = function (options) { | ||
module.exports = function (opt) { | ||
opt.out = opt.out || process.stdout; | ||
opt.err = opt.err || process.stderr; | ||
var ev = new EventEmitter(); | ||
@@ -20,21 +22,20 @@ var currentModule = undefined; | ||
currentModule = mod.name; | ||
console.log("\n" + mod.name); | ||
opt.out.write("\n" + mod.name + "\n"); | ||
} | ||
if (options.verbose) { | ||
console.log(" " + mod.version); | ||
return; | ||
if (opt.verbose) { | ||
opt.out.write(" " + mod.version + "\n"); | ||
}if (opt.out.isTTY) { | ||
spin = spinner(15, function (c) { | ||
opt.out.clearLine(); | ||
opt.out.cursorTo(0); | ||
opt.out.write(" " + c + " " + mod.version); | ||
}); | ||
} | ||
spin = spinner(15, function (c) { | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
process.stdout.write(" " + c + " " + mod.version); | ||
}); | ||
}); | ||
ev.on("test", function (mod, p) { | ||
if (options.verbose) { | ||
p.stdout.pipe(indentStream(4)).pipe(process.stdout); | ||
p.stderr.pipe(indentStream(4)).pipe(process.stderr); | ||
if (opt.verbose) { | ||
p.stdout.pipe(indentStream(4)).pipe(opt.out); | ||
p.stderr.pipe(indentStream(4)).pipe(opt.err); | ||
} | ||
@@ -45,10 +46,14 @@ }); | ||
return function (mod) { | ||
if (options.verbose) { | ||
console.log("\n " + mark + " " + msg + "\n"); | ||
} else { | ||
if (opt.verbose) { | ||
opt.out.write("\n " + mark + " " + msg + "\n\n"); | ||
return; | ||
} | ||
if (opt.out.isTTY) { | ||
spin.stop(); | ||
process.stdout.clearLine(); | ||
process.stdout.cursorTo(0); | ||
console.log(" " + mark + " " + mod.version); | ||
opt.out.clearLine(); | ||
opt.out.cursorTo(0); | ||
} | ||
opt.out.write(" " + mark + " " + mod.version + "\n"); | ||
}; | ||
@@ -55,0 +60,0 @@ } |
{ | ||
"name": "alltheversions", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Run your tests against ALL THE VERSIONS!", | ||
@@ -5,0 +5,0 @@ "author": "Stephen Belanger <admin@stephenbelanger.com>", |
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
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
15885
474