GeezerVison is showing github.com — test_runner: output errors of suites · nodejs/node@29c68a2
File tree
Expand file treeCollapse file tree
Open diff view settings
lib/internal/test_runner/reporter fixtures/test-runner/output
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/test_runner/reporter/spec.js +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -78,11 +78,12 @@ class SpecReporter extends Transform { |
78 | 78 | } else if (todo !== undefined) { |
79 | 79 | title += ` # ${typeof todo === 'string' && todo.length ? todo : 'TODO'}`; |
80 | 80 | } |
| 81 | + const error = this.#formatError(data.details?.error, indent); |
81 | 82 | if (hasChildren) { |
82 | 83 | // If this test has had children - it was already reported, so slightly modify the output |
83 | | - return `${prefix}${indent}${color}${symbols['arrow:right']}${white}${title}\n`; |
| 84 | + const err = data.details?.error?.failureType === 'subtestsFailed' ? '' : error; |
| 85 | + return `${prefix}${indent}${color}${symbols['arrow:right']}${white}${title}\n${err}`; |
84 | 86 | } |
85 | | - const error = this.#formatError(data.details?.error, indent); |
86 | 87 | if (skip !== undefined) { |
87 | 88 | color = gray; |
88 | 89 | symbol = symbols['hyphen:minus']; |
|
Collapse file
Copy file name to clipboard +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +'use strict'; |
| 2 | +require('../../../common'); |
| 3 | +const fixtures = require('../../../common/fixtures'); |
| 4 | +const spawn = require('node:child_process').spawn; |
| 5 | + |
| 6 | +const child = spawn(process.execPath, |
| 7 | + ['--no-warnings', '--test-reporter', 'spec', fixtures.path('test-runner/output/hooks.js')], |
| 8 | + { stdio: 'pipe' }); |
| 9 | +// eslint-disable-next-line no-control-regex |
| 10 | +child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, ''))); |
| 11 | +child.stderr.pipe(process.stderr); |