results.failures is undefined if there are no failures
Closed this issue · 1 comments
Jameskmonger commented
When running a group of tests with 4 assertions, all of which pass, the following listener gives an output I wouldn't expect:
input.on('complete', function (results) {
console.log(results);
});
Results here is:
{ ok: true, count: 4, pass: 4, plan: { start: 1, end: 4 } }
Whereas if one of the tests failed, it would be:
{ ok: true, count: 4, failures: [ array of failures here ], pass: 3, plan: { start: 1, end: 4 } }
I would expect failures
to be an empty array if there were none. This would make it easier to iterate over.