Re-output failing tests after summary has been printed. This behavior follows other popular test runners (e.g. jest, mocha, etc...). Updated SpecReporter: 1. When there is a 'test:fail' event, the test will be stored. 2. After no more input, all the failed tests will be flushed. 3. Extract the logic for formatting a test report into a re-usable function. Fixes: https://github.com/nodejs/node/issues/47110 PR-URL: https://github.com/nodejs/node/pull/47164 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
15 lines
443 B
JavaScript
15 lines
443 B
JavaScript
'use strict';
|
|
process.env.FORCE_COLOR = '1';
|
|
delete process.env.NODE_DISABLE_COLORS;
|
|
delete process.env.NO_COLOR;
|
|
|
|
require('../common');
|
|
const test = require('node:test');
|
|
|
|
test('should pass', () => {});
|
|
test('should fail', () => { throw new Error('fail'); });
|
|
test('should skip', { skip: true }, () => {});
|
|
test('parent', () => {
|
|
test('should fail', () => { throw new Error('fail'); });
|
|
test('should pass but parent fail', () => {});
|
|
});
|