jest-skipped-reporter
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "jest-skipped-reporter", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Report skipped tests in Jest", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,2 +8,3 @@ <h1 align="center"> | ||
## Installation | ||
Using yarn: | ||
@@ -10,0 +11,0 @@ |
@@ -7,2 +7,4 @@ const jestUtils = require('jest-util'); | ||
this.stdio = new StdIo(); | ||
this.skipped = {}; | ||
this.skippedCount = 0; | ||
} | ||
@@ -17,2 +19,15 @@ | ||
onRunComplete() { | ||
if (this.skippedCount > 0) { | ||
const suites = Object.keys(this.skipped); | ||
this.stdio.log( | ||
`Skipped ${this.skippedCount} specs in ${suites.length} suites` | ||
); | ||
suites.forEach(path => { | ||
const skippedTestNames = this.skipped[path]; | ||
this.stdio.log(` Skipped ${skippedTestNames.length} specs in ${path}`); | ||
skippedTestNames.forEach(name => { | ||
this.stdio.log(` - ${name}`); | ||
}); | ||
}); | ||
} | ||
this.stdio.close(); | ||
@@ -23,13 +38,12 @@ } | ||
if (testResult.numPendingTests > 0) { | ||
this.stdio.log( | ||
`Skipped ${testResult.numPendingTests} specs in ${ | ||
testResult.testFilePath | ||
}` | ||
this.skipped[testResult.testFilePath] = testResult.testResults.reduce( | ||
(skipped, result) => { | ||
if (result.status === 'pending') { | ||
this.skippedCount += 1; | ||
skipped.push(result.fullName); | ||
} | ||
return skipped; | ||
}, | ||
[] | ||
); | ||
for (const result of testResult.testResults) { | ||
if (result.status === 'pending') { | ||
this.stdio.log(` ${result.fullName}`); | ||
} | ||
} | ||
} | ||
@@ -36,0 +50,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
33413
105
40