Skip to content

Commit ddbce53

Browse files
cjihrigMoLow
authored andcommitted
fix: remove stdout and stderr from error
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: nodejs/node#45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> (cherry picked from commit fec0fbc333c58e6ebbd2322f5120830fda880eb0)
1 parent 6cd562d commit ddbce53

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/internal/test_runner/runner.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// https://github.com/nodejs/node/blob/f8ce9117b19702487eb600493d941f7876e00e01/lib/internal/test_runner/runner.js
1+
// https://github.com/nodejs/node/blob/fec0fbc333c58e6ebbd2322f5120830fda880eb0/lib/internal/test_runner/runner.js
22
'use strict'
33
const {
44
ArrayFrom,
@@ -225,18 +225,13 @@ function runTestFile (path, root, inspectPort, filesWatcher) {
225225
const child = spawn(process.execPath, args, { signal: t.signal, encoding: 'utf8', env, stdio })
226226

227227
let err
228-
let stderr = ''
229228

230229
filesWatcher?.watchChildProcessModules(child, path)
231230

232231
child.on('error', (error) => {
233232
err = error
234233
})
235234

236-
child.stderr.on('data', (data) => {
237-
stderr += data
238-
})
239-
240235
if (isUsingInspector()) {
241236
const rl = createInterface({ input: child.stderr })
242237
rl.on('line', (line) => {
@@ -257,7 +252,7 @@ function runTestFile (path, root, inspectPort, filesWatcher) {
257252
subtest.addToReport(ast)
258253
})
259254

260-
const { 0: { 0: code, 1: signal }, 1: stdout } = await SafePromiseAll([
255+
const { 0: { 0: code, 1: signal } } = await SafePromiseAll([
261256
once(child, 'exit', { signal: t.signal }),
262257
toArray.call(child.stdout, { signal: t.signal })
263258
])
@@ -268,8 +263,6 @@ function runTestFile (path, root, inspectPort, filesWatcher) {
268263
__proto__: null,
269264
exitCode: code,
270265
signal,
271-
stdout: ArrayPrototypeJoin(stdout, ''),
272-
stderr,
273266
// The stack will not be useful since the failures came from tests
274267
// in a child process.
275268
stack: undefined

0 commit comments

Comments
 (0)