From b188f903ce41e624d6169f47a0c9e5091c178160 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 16 Feb 2016 21:03:26 -0800 Subject: [PATCH] Add fp tests for iteratee shorthands. --- test/test-fp.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/test-fp.js b/test/test-fp.js index 12378a77d..414c75511 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -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() {