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 <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
  • Loading branch information
cjihrig authored and targos committed Dec 12, 2022
1 parent c842120 commit c9cbd1d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
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 c9cbd1d

Please sign in to comment.