testem-time-reporter
Advanced tools
Comparing version 1.2.1 to 1.2.2
28
index.js
@@ -17,14 +17,14 @@ /* 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 = { | ||
writeFailure: function (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 = { | ||
report: function (prefix, data) { | ||
@@ -37,3 +37,3 @@ this.runDuration += data.runDuration; | ||
if (data.failed) { | ||
writeFailure(data); | ||
this.writeFailure(data); | ||
} | ||
@@ -76,4 +76,4 @@ if (data.passed) { | ||
if (this.failures.length) { | ||
write('\n Failing tests: \n'); | ||
this.failures.forEach(writeFailure); | ||
this.write('\n Failing tests: \n'); | ||
this.failures.forEach(this.writeFailure); | ||
} | ||
@@ -80,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.1", | ||
"version": "1.2.2", | ||
"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
9575