Closed Jameskmonger closed 7 years ago
Seems reasonable to me. I think the only reason they're emitted is to reduce noise when they're output in yaml by harnesses. But that'd usually only happen on failure, so it's fine.
Great @isaacs
Would be a lot easier if I could do this:
parser.on("complete", results => {
let totals = {
pass: results.pass,
fail: results.fail,
skip: results.skip + results.todo
};
});
Rather than:
parser.on("complete", results => {
let totals = {
pass: results.pass,
fail: results.fail || 0,
skip: (results.skip || 0) + (results.todo || 0)
};
});
Agreed! Patch welcome. Should be pretty straightforward.
@isaacs this has been submitted for PR in #44
Closed by #44, thanks @isaacs
I think we should emit
fail
,todo
andskip
oncomplete
all the time, even if they're falsy.That way it's easier to consume the event because you don't need to check for undefined when consuming it. It also makes the object schema a bit more consistent.
What do you guys think? @isaacs @sindresorhus @ljharb