tapjs / tap-parser

parse the test anything protocol
121 stars 35 forks source link

TAP output (stdout) from child process does not always reach parent process #50

Closed ORESoftware closed 7 years ago

ORESoftware commented 7 years ago

I opened this issue with Node:

https://github.com/nodejs/node/issues/11415

It's a common issue I think. TBVH I was always afraid of this problem - that stdout would not reach the parent, or that it would be unreliable.

Have you seen this problem and discovered any solutions to it?

ORESoftware commented 7 years ago

Ok I think I have a solution, looks like I was exiting before tap-parser had a chance to parse everything, so my solution is akin to:

const dest = n.stdout.pipe(tapParser());

dest.on('finish', function(){
     process.exit(0);
});

now it seems to work