8000 Add fp tests for iteratee shorthands. · lodash/lodash@b188f90 · GitHub
[go: up one dir, main page]

Skip to content

Commit b188f90

Browse files
committed
Add fp tests for iteratee shorthands.
1 parent 7b93dc9 commit b188f90

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/test-fp.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,32 @@
526526

527527
/*--------------------------------------------------------------------------*/
528528

529+
QUnit.module('iteratee shorthands');
530+
531+
(function() {
532+
var objects = [{ 'a': 1, 'b': 2 }, { 'a': 3, 'b': 4 }];
533+
534+
QUnit.test('should work with "_.matches" shorthands', function(assert) {
535+
assert.expect(1);
536+
537+
assert.deepEqual(fp.filter({ 'a': 3 })(objects), [objects[1]]);
538+
});
539+
540+
QUnit.test('should work with "_.matchesProperty" shorthands', function(assert) {
541+
assert.expect(1);
542+
543+
assert.deepEqual(fp.filter(['a', 3])(objects), [objects[1]]);
544+
});
545+
546+
QUnit.test('should work with "_.property" shorthands', function(assert) {
547+
assert.expect(1);
548+
549+
assert.deepEqual(fp.map('a')(objects), [1, 3]);
550+
});
551+
}());
552+
553+
/*--------------------------------------------------------------------------*/
554+
529555
QUnit.module('mutation methods');
530556

531557
(function() {

0 commit comments

Comments
 (0)
0