Skip to content

Commit 3638be8

Browse files
committed
test_runner: hide failing tests when all tests pass
1 parent 85705a4 commit 3638be8

File tree

1 file changed

+4
-1
lines changed
  • lib/internal/test_runner/reporter

1 file changed

+4
-1
lines changed

lib/internal/test_runner/reporter/spec.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ class SpecReporter extends Transform {
121121
callback(null, this.#handleEvent({ type, data }));
122122
}
123123
_flush(callback) {
124-
const results = [`\n${colors['test:fail']}${symbols['test:fail']}failing tests:${white}\n`];
124+
const results = [];
125+
if (this.#failedTests.length > 0) {
126+
ArrayPrototypePush(results, `\n${colors['test:fail']}${symbols['test:fail']}failing tests:${white}\n`);
127+
}
125128
for (let i = 0; i < this.#failedTests.length; i++) {
126129
ArrayPrototypePush(results, this.#formatTestReport(
127130
'test:fail',

0 commit comments

Comments
 (0)