mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Add fp tests for iteratee shorthands.
This commit is contained in:
@@ -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');
|
QUnit.module('mutation methods');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user