Skip to content

Commit

Permalink
Tests when findWhere can't find anything
Browse files Browse the repository at this point in the history
  • Loading branch information
JensRantil committed Jun 10, 2013
1 parent 3cfdd41 commit c8b729e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ $(document).ready(function() {
deepEqual(result, {a: 1, b: 2});
result = _.findWhere(list, {b: 4});
deepEqual(result, {a: 1, b: 4});

result = _.findWhere(list, {c:1})
ok(_.isUndefined(result), "undefined when not found");

result = _.findWhere([], {c:1});
ok(_.isUndefined(result), "undefined when searching empty list");
});

test('max', function() {
Expand Down

0 comments on commit c8b729e

Please sign in to comment.