Skip to content

Commit

Permalink
test_runner: remove stdout and stderr from error
Browse files Browse the repository at this point in the history
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#45592
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
  • Loading branch information
cjihrig authored and ErickWendel committed Nov 30, 2022
1 parent 7ee3f8b commit 54adeb9
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/internal/test_runner/runner.js
Expand Up @@ -234,18 +234,13 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
runningProcesses.set(path, child);

let err;
let stderr = '';

filesWatcher?.watchChildProcessModules(child, path);

child.on('error', (error) => {
err = error;
});

child.stderr.on('data', (data) => {
stderr += data;
});

if (isUsingInspector()) {
const rl = createInterface({ input: child.stderr });
rl.on('line', (line) => {
Expand All @@ -266,7 +261,7 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
subtest.addToReport(ast);
});

const { 0: { 0: code, 1: signal }, 1: stdout } = await SafePromiseAll([
const { 0: { 0: code, 1: signal } } = await SafePromiseAll([
once(child, 'exit', { signal: t.signal }),
child.stdout.toArray({ signal: t.signal }),
]);
Expand All @@ -279,8 +274,6 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
__proto__: null,
exitCode: code,
signal: signal,
stdout: ArrayPrototypeJoin(stdout, ''),
stderr,
// The stack will not be useful since the failures came from tests
// in a child process.
stack: undefined,
Expand Down

0 comments on commit 54adeb9

Please sign in to comment.