diff --git a/lib/result.js b/lib/result.js index 9fcd5d204..0a4c3d011 100644 --- a/lib/result.js +++ b/lib/result.js @@ -41,7 +41,7 @@ class Result { } get failures() { - return this._failures + return this._failures.filter(f => f && (!Array.isArray(f) || f.length > 0)) } get stats() { diff --git a/test/unit/worker_test.js b/test/unit/worker_test.js index fe051ca45..811eeae87 100644 --- a/test/unit/worker_test.js +++ b/test/unit/worker_test.js @@ -29,7 +29,7 @@ describe('Workers', function () { workers.run() workers.on(event.all.result, result => { - expect(result.hasFailed).equal(false) + expect(result.hasFailed).equal(true) expect(passedCount).equal(5) expect(failedCount).equal(3) done() @@ -101,7 +101,7 @@ describe('Workers', function () { }) workers.on(event.all.result, result => { - expect(result.hasFailed).equal(false) + expect(result.hasFailed).equal(true) expect(passedCount).equal(3) expect(failedCount).equal(2) done()