Skip to content

Commit

Permalink
_.map context coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gyeates committed Jun 20, 2014
1 parent a919c44 commit dd23ee6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@
});
deepEqual(ids, ['1', '2'], 'Can use collection methods on Array-likes.');

var ifnull = _.map(null, function(){});
ok(_.isArray(ifnull) && ifnull.length === 0, 'handles a null properly');
deepEqual(_.map(null, _.noop), [], 'handles a null properly');

deepEqual(_.map([1], function() {
return this.length;
}, [5]), [1], 'called with context');

// Passing a property name like _.pluck.
var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}];
Expand Down

0 comments on commit dd23ee6

Please sign in to comment.