tapjs / tap-parser

parse the test anything protocol
121 stars 35 forks source link

Support of Streams2 and/or Streams3 #42

Closed Tokimon closed 4 years ago

Tokimon commented 8 years ago

Hi

I am a happy user of tap-parser but recently I tried to use duplexer2 to combine the parser with a readable stream, using it from a script, and then it doesn't call the 'complete' event once the tests are done. I suspect it is because the "old" stream is used:

var Writable = require('stream').Writable

Is there a way to either use latest streams version with backwards comparability? or perhaps make the parser stream agnostic, by expecting to be given a writable stream object? or at least make it possible to give another writable stream object which will be used instead?

derhuerst commented 7 years ago

bump. (: @Tokimon what did you end up using?

isaacs commented 7 years ago

I don't really understand the request here. The parser itself is a Writable stream. You can pipe pretty much any Readable stream into it. The complete event comes after parser.end() is called.

isaacs commented 7 years ago

That is, it supports Streams2 and Streams3 from Node.js core, or anything compatible with core streams.

Tokimon commented 7 years ago

This question derived from a misunderstanding on how to use the stream in this context. I ended up using child_process.spawn() to bind the stream together and get the correct output. I just tried to do everything 'in-code', which didn't really work. So this is not really any issue anymore.