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: #45592
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
  • Loading branch information
cjihrig authored and danielleadams committed Jan 3, 2023
1 parent 1e48a5a commit 20f6fa3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/internal/test_runner/runner.js
Expand Up @@ -233,18 +233,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 @@ -265,7 +260,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 @@ -278,8 +273,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 20f6fa3

Please sign in to comment.