jest-summarizing-reporter
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "jest-summarizing-reporter", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Custom reporter for jest, that only prints test result summary.", | ||
@@ -5,0 +5,0 @@ "main": "./src/JestSummaryReporter.js", |
@@ -14,2 +14,3 @@ const { red, green, black, bgLightGreen, bgLightRed, lightRed, lightYellow, white, yellow } = require('./utils/BashColorUtils'); | ||
onRunComplete(contexts, results) { | ||
const { snapshot } = results; | ||
println(2); | ||
@@ -25,2 +26,5 @@ | ||
printFailedSuites(results); | ||
if (snapshot.failure) { | ||
printUncheckedSnapshotsSummary(snapshot); | ||
} | ||
printSummary(results); | ||
@@ -61,6 +65,7 @@ } | ||
numPassedTests: passedTests, | ||
numFailedTests: failedTests | ||
numFailedTests: failedTests, | ||
success | ||
} = results; | ||
let failedSuites = totalSuites - passedSuites - pendingSuites; | ||
let failed = failedSuites > 0; | ||
let failed = !success; | ||
@@ -115,3 +120,14 @@ print('Summary:'); | ||
function printUncheckedSnapshotsSummary(snapshot) { | ||
print(`${bgLightRed(black(" UNUSED SNAPSHOTS "))} found. 'npm t -- -u' to remove them`); | ||
snapshot.uncheckedKeysByFile | ||
.forEach(printAsFailure); | ||
println(2); | ||
function printAsFailure(file) { | ||
let path = processFullPath(file.filePath); | ||
print(`${path.path}${white(path.file)}`); | ||
} | ||
} | ||
function suiteFailed(suite) { | ||
@@ -118,0 +134,0 @@ return suite.numFailingTests > 0 || suite.failureMessage; |
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
12663
21
294