Skip to content

Commit

Permalink
test_runner: hide failing tests when all tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Apr 2, 2023
1 parent 85705a4 commit 3638be8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/internal/test_runner/reporter/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ class SpecReporter extends Transform {
callback(null, this.#handleEvent({ type, data }));
}
_flush(callback) {
const results = [`\n${colors['test:fail']}${symbols['test:fail']}failing tests:${white}\n`];
const results = [];
if (this.#failedTests.length > 0) {
ArrayPrototypePush(results, `\n${colors['test:fail']}${symbols['test:fail']}failing tests:${white}\n`);
}
for (let i = 0; i < this.#failedTests.length; i++) {
ArrayPrototypePush(results, this.#formatTestReport(
'test:fail',
Expand Down

0 comments on commit 3638be8

Please sign in to comment.