joe-reporter-compact
Advanced tools
Comparing version 0.1.2 to 0.1.3
28
index.js
@@ -5,2 +5,4 @@ /*global process, module, require, window*/ | ||
var ConsoleReporter = require('joe-reporter-console'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
@@ -100,3 +102,9 @@ var isBrowser = (typeof window === 'undefined') ? false : true; | ||
var summary = ""; | ||
function log(message){ | ||
console.log(message); | ||
summary+= message+"\n"; | ||
} | ||
CompactReporter.prototype.exit = function (exitCode) { | ||
@@ -116,5 +124,7 @@ var totals = this.joe.getTotals(); | ||
}); | ||
console.log(this.config.summaryFail, totalPassedTests, totalTests, totalFailedTests, totalIncompleteTests, totalErrors); | ||
console.log("-----------------------------"); | ||
console.log(this.color("Error summary:", "red","bold")); | ||
summary = ""; | ||
var msg = util.format(this.config.summaryFail, totalPassedTests, totalTests, totalFailedTests, totalIncompleteTests, totalErrors); | ||
log(msg); | ||
log("-----------------------------"); | ||
log(this.color("Error summary:", "red","bold")); | ||
var lastSuit = ""; | ||
@@ -126,14 +136,16 @@ for (var i = 0; i < errorLogs.length; i++) { | ||
if (suite !== lastSuit) { | ||
console.log("Suite: ", suite); | ||
log("Suite: "+ suite); | ||
lastSuit = suite; | ||
} | ||
console.log(this.indent, i + 1 + ": ", test.getConfig().name); | ||
log(this.indent+ i + 1 + ": "+ test.getConfig().name); | ||
} | ||
console.log("-----------------------------"); | ||
log("-----------------------------"); | ||
} else { | ||
console.log("\n" + this.config.summaryPass, totalPassedTests, totalTests); | ||
log("\n" + util.format(this.config.summaryPass, totalPassedTests, totalTests)); | ||
} | ||
summary = summary.replace(/\[\d+m/g,''); | ||
var outfile = path.join(process.cwd(),"summary.txt"); | ||
fs.writeFileSync(outfile,summary,'utf-8'); | ||
this.onFinish(this); | ||
@@ -140,0 +152,0 @@ |
{ | ||
"name": "joe-reporter-compact", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Compact Reporter for the Joe Testing Framework", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/SteveMcArthur/joe-reporter-compact", |
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
8599
124
1