testem-time-reporter
Advanced tools
Comparing version 1.2.0 to 1.2.1
22
index.js
@@ -17,2 +17,13 @@ /* eslint-env node */ | ||
function writeFailure (data) { | ||
write(chalk.red(`\nTest Failure - ${data.name.trim()}\n`)); | ||
if (data.error) { | ||
write(JSON.stringify(data.error.message, null, 2) + '\n'); | ||
write(typeof data.error === 'string' ? data.error : JSON.stringify(data.error, null, 2)); | ||
} else { | ||
write(chalk.red(`\t Test failed with no error object. ${JSON.stringify(data)}`)); | ||
} | ||
this.failures.push(data); | ||
} | ||
TimeReporter.prototype = { | ||
@@ -26,6 +37,3 @@ report: function (prefix, data) { | ||
if (data.failed) { | ||
write(chalk.red(`\nTest Failure - ${data.name.trim()}\n`)); | ||
write(JSON.stringify(data.error.message, null, 2) + '\n'); | ||
write(typeof data.error === 'string' ? data.error : JSON.stringify(data.error, null, 2)); | ||
this.failures.push(data); | ||
writeFailure(data); | ||
} | ||
@@ -69,7 +77,3 @@ if (data.passed) { | ||
write('\n Failing tests: \n'); | ||
this.failures.forEach(data => { | ||
write(chalk.red(`\nTest Failure - ${data.name.trim()}\n`)); | ||
write(JSON.stringify(data.error.message, null, 2) + '\n'); | ||
write(typeof data.error === 'string' ? data.error : JSON.stringify(data.error, null, 2)); | ||
}); | ||
this.failures.forEach(writeFailure); | ||
} | ||
@@ -76,0 +80,0 @@ write(`\nLEGEND: ${chalk.blue('Skipped')} ${chalk.magenta('Tests > 2 seconds')} ${chalk.red('Tests > 1 second')} ${chalk.yellow('Tests > 0.5 seconds')}\n`); |
{ | ||
"name": "testem-time-reporter", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A testem reporter for highlighting tests", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
178
9538