mirror of https://github.com/nodejs/node.git
test_runner: hide failing tests title when all tests pass
PR-URL: https://github.com/nodejs/node/pull/47370 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
102540aef9
commit
af8ed02067
|
@ -124,6 +124,10 @@ class SpecReporter extends Transform {
|
|||
callback(null, this.#handleEvent({ type, data }));
|
||||
}
|
||||
_flush(callback) {
|
||||
if (this.#failedTests.length === 0) {
|
||||
callback(null, '');
|
||||
return;
|
||||
}
|
||||
const 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(
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// Flags: --no-warnings --test-reporter=spec
|
||||
'use strict';
|
||||
require('../common');
|
||||
const { it } = require('node:test');
|
||||
|
||||
it('should pass', () => {});
|
|
@ -0,0 +1,9 @@
|
|||
* should pass *(*ms)*
|
||||
*tests 1*
|
||||
*suites 0*
|
||||
*pass 1*
|
||||
*fail 0*
|
||||
*cancelled 0*
|
||||
*skipped 0*
|
||||
*todo 0*
|
||||
*duration_ms *
|
Loading…
Reference in New Issue