Skip to content

Commit 20f6fa3

Browse files
cjihrigdanielleadams
authored andcommitted
test_runner: 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: #45592 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent 1e48a5a commit 20f6fa3

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/internal/test_runner/runner.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,13 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
233233
runningProcesses.set(path, child);
234234

235235
let err;
236-
let stderr = '';
237236

238237
filesWatcher?.watchChildProcessModules(child, path);
239238

240239
child.on('error', (error) => {
241240
err = error;
242241
});
243242

244-
child.stderr.on('data', (data) => {
245-
stderr += data;
246-
});
247-
248243
if (isUsingInspector()) {
249244
const rl = createInterface({ input: child.stderr });
250245
rl.on('line', (line) => {
@@ -265,7 +260,7 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
265260
subtest.addToReport(ast);
266261
});
267262

268-
const { 0: { 0: code, 1: signal }, 1: stdout } = await SafePromiseAll([
263+
const { 0: { 0: code, 1: signal } } = await SafePromiseAll([
269264
once(child, 'exit', { signal: t.signal }),
270265
child.stdout.toArray({ signal: t.signal }),
271266
]);
@@ -278,8 +273,6 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
278273
__proto__: null,
279274
exitCode: code,
280275
signal: signal,
281-
stdout: ArrayPrototypeJoin(stdout, ''),
282-
stderr,
283276
// The stack will not be useful since the failures came from tests
284277
// in a child process.
285278
stack: undefined,

0 commit comments

Comments
 (0)