Closed ORESoftware closed 7 years ago
as an aside, sorry for the dumb TAP questions -
is the output from the 'complete' event (aka the FinalResults
object) ever intended to be input for another process? Or is that just for human consumption?
With that input, I get a complete results object with plenty of interesting data. It reports that there were 4 passes, and 1 fail for "missing plan".
$ cat <<END | tap-parser
ok 1 a
ok 2 b
ok 3 c
ok 4 d
END
[ [ 'assert', Result { ok: true, id: 1, name: 'a' } ],
[ 'assert', Result { ok: true, id: 2, name: 'b' } ],
[ 'assert', Result { ok: true, id: 3, name: 'c' } ],
[ 'assert', Result { ok: true, id: 4, name: 'd' } ],
[ 'comment', '# test count(4) != plan(null)\n' ],
[ 'comment', '# failed 1 of 4 tests\n' ],
[ 'complete',
FinalResults {
ok: false,
count: 4,
pass: 4,
fail: 1,
bailout: false,
todo: 0,
skip: 0,
plan:
FinalPlan {
start: null,
end: null,
skipAll: false,
skipReason: '',
comment: '' },
failures: [ { tapError: 'no plan' } ] } ] ]
(Same effect using the parser stream programmatically, just showing using the cli for clarity.)
I get this console output from my program using tap-parser:
however, several 'assert ok' events went through this same parser...I assume that the parser itself is what keeps track of the number of pass/fails, otherwise I don't know why the parser complete event would report the accumulated data...here's my code:
for this
parser()
instance, severaltestpoint.ok
events have taken place. Any idea why the pass count would be 0?if it's not clear, I can try to clarify, but not sure how to make it clearer ATM. I am probably misusing the lib, just not sure how.