tapjs/tap-parser

Bailout event emitted before the assert just before

Closed this issue · 2 comments

anko commented

#18-related?

SSCCE:

index.js (marked executable):

#!/usr/bin/env node
var t = require("tap-parser")();
t.on("assert",  function() { console.log("ASSERT" ); });
t.on("bailout", function() { console.log("BAILOUT"); });

process.stdin.pipe(t);

Run it with input:

$ ./index.js <<_
ok
ok
bail out!
_

Expected output:

ASSERT
ASSERT
BAILOUT

Actual output:

ASSERT
BAILOUT
ASSERT

I agree, this is weird behavior.

Fixed in v2.