Skip to content

Commit

Permalink
Add fp tests for iteratee shorthands.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Feb 17, 2016
1 parent 7b93dc9 commit b188f90
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/test-fp.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,32 @@

/*--------------------------------------------------------------------------*/

QUnit.module('iteratee shorthands');

(function() {
var objects = [{ 'a': 1, 'b': 2 }, { 'a': 3, 'b': 4 }];

QUnit.test('should work with "_.matches" shorthands', function(assert) {
assert.expect(1);

assert.deepEqual(fp.filter({ 'a': 3 })(objects), [objects[1]]);
});

QUnit.test('should work with "_.matchesProperty" shorthands', function(assert) {
assert.expect(1);

assert.deepEqual(fp.filter(['a', 3])(objects), [objects[1]]);
});

QUnit.test('should work with "_.property" shorthands', function(assert) {
assert.expect(1);

assert.deepEqual(fp.map('a')(objects), [1, 3]);
});
}());

/*--------------------------------------------------------------------------*/

QUnit.module('mutation methods');

(function() {
Expand Down

0 comments on commit b188f90

Please sign in to comment.