correct some formatting in the terminal runner
This commit is contained in:
parent
cbf48ff3b1
commit
1d1ae4e91e
1 changed files with 5 additions and 1 deletions
|
@ -58,6 +58,10 @@ const makeSummary = results => {
|
||||||
toString() {
|
toString() {
|
||||||
const summary = `test result: ${failed}. ${passed} passed; ${failed} failed`
|
const summary = `test result: ${failed}. ${passed} passed; ${failed} failed`
|
||||||
|
|
||||||
|
if (failed === 0) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
const failures = results
|
const failures = results
|
||||||
.filter(result => result.failed.length)
|
.filter(result => result.failed.length)
|
||||||
.flatMap(result =>
|
.flatMap(result =>
|
||||||
|
@ -76,7 +80,7 @@ export const TerminalRunner = tests => {
|
||||||
return {
|
return {
|
||||||
results,
|
results,
|
||||||
toString() {
|
toString() {
|
||||||
const suites = results.map(r => r.toString())
|
const suites = results.map(r => r.toString()).join('\n')
|
||||||
const summary = makeSummary(results).toString()
|
const summary = makeSummary(results).toString()
|
||||||
return `${suites}\n${summary}`
|
return `${suites}\n${summary}`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue