Skip to content

Commit

Permalink
Added test for filter with an object-collection, where the filtering …
Browse files Browse the repository at this point in the history
…fails. To improve coverage.
  • Loading branch information
erik-krogh committed Mar 14, 2017
1 parent d7bc238 commit 3e8377d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mocha_test/filter.js
Expand Up @@ -172,4 +172,17 @@ describe("reject", function () {
});
});

it('filter fails', function(done) {
async.filter({a: 1, b: 2, c: 3}, function (item, callback) {
if (item === 3) {
callback("error", false);
} else {
callback(null, true);
}
}, function (err, res) {
expect(err).to.equal("error");
expect(res).to.equal(undefined);
done();
})
});
});

0 comments on commit 3e8377d

Please sign in to comment.