Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,7 @@ function run(file) {
.on('stats', stats)
.on('test', test)
.on('unhandledRejections', handleRejections)
.on('uncaughtException', handleExceptions)
.on('data', function (data) {
process.stdout.write(data);
});
.on('uncaughtException', handleExceptions);
}

function handleRejections(data) {
Expand Down
13 changes: 2 additions & 11 deletions lib/fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module.exports = function (args) {
var file = args[0];

var options = {
silent: true,
cwd: path.dirname(file)
cwd: path.dirname(file),
stdio: ['ignore', process.stdout, process.stdout]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why we forward both child output streams to stdout. I do it here simply because it is what we were doing before. Making that change will impact a lot of tests, and is a separate PR.

In my mind what we are currently doing makes the least sense of the the available options. I think we should either:

  1. pipe child.stdout -> process.stdout, and child.stderr -> process.stderr.
  2. pipe both to process.stderr. This keeps process.stdout pristine and will not interfere with our TAP output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you open an issue with the contents of this comment? I'm not sure to be honest.

};

var ps = childProcess.fork(filepath, args, options);
Expand Down Expand Up @@ -76,15 +76,6 @@ module.exports = function (args) {
send(ps, 'teardown');
});

// emit data events on forked process' output
ps.stdout.on('data', function (data) {
ps.emit('data', data);
});

ps.stderr.on('data', function (data) {
ps.emit('data', data);
});

promise.on = function () {
ps.on.apply(ps, arguments);

Expand Down