Skip to content

Commit 306f28d

Browse files
committed
Merge pull request #275 from jamestalmage/pipe-forked-io-streams
Pipe forked IO streams instead of forwarding `data` events.
2 parents b370458 + 0ef0ca1 commit 306f28d

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

cli.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ function run(file) {
126126
.on('stats', stats)
127127
.on('test', test)
128128
.on('unhandledRejections', handleRejections)
129-
.on('uncaughtException', handleExceptions)
130-
.on('data', function (data) {
131-
process.stdout.write(data);
132-
});
129+
.on('uncaughtException', handleExceptions);
133130
}
134131

135132
function handleRejections(data) {

lib/fork.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ module.exports = function (args) {
1414
var file = args[0];
1515

1616
var options = {
17-
silent: true,
18-
cwd: path.dirname(file)
17+
cwd: path.dirname(file),
18+
stdio: ['ignore', process.stdout, process.stdout]
1919
};
2020

2121
var ps = childProcess.fork(filepath, args, options);
@@ -76,15 +76,6 @@ module.exports = function (args) {
7676
send(ps, 'teardown');
7777
});
7878

79-
// emit data events on forked process' output
80-
ps.stdout.on('data', function (data) {
81-
ps.emit('data', data);
82-
});
83-
84-
ps.stderr.on('data', function (data) {
85-
ps.emit('data', data);
86-
});
87-
8879
promise.on = function () {
8980
ps.on.apply(ps, arguments);
9081

0 commit comments

Comments
 (0)