Skip to content

Commit fec0fbc

Browse files
authored
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 a01dbf1 commit fec0fbc

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
@@ -234,18 +234,13 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
234234
runningProcesses.set(path, child);
235235

236236
let err;
237-
let stderr = '';
238237

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

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

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

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

0 commit comments

Comments
 (0)