From b833d83a3e485f9222d207dcf439a352ccfa608a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 5 Nov 2016 16:43:56 -0700 Subject: [PATCH] =?UTF-8?q?Add=20tests=20for=20=E2=80=9CAllWith=E2=80=9D?= =?UTF-8?q?=20fp=20methods.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test-fp.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test-fp.js b/test/test-fp.js index a7803be7c..103e3fb76 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -801,6 +801,17 @@ assert.deepEqual(objects[0], { 'a': 1 }); assert.deepEqual(actual, { 'a': 1, 'b': 2 }); }); + + QUnit.test('`fp.' + methodName + '` should work with more than two sources', function(assert) { + assert.expect(2); + + var pass = false, + objects = [{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }], + actual = func(function() { pass = true; })(objects); + + assert.ok(pass); + assert.deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 }); + }); }); /*--------------------------------------------------------------------------*/ @@ -1518,6 +1529,17 @@ assert.deepEqual(objects[0], { 'a': [1, 2] }); assert.deepEqual(actual, { 'a': [3, 2] }); }); + + QUnit.test('should work with more than two sources', function(assert) { + assert.expect(2); + + var pass = false, + objects = [{ 'a': 1 }, { 'b': 2 }, { 'c': 3 }], + actual = fp.mergeAllWith(function() { pass = true; }, objects); + + assert.ok(pass); + assert.deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 }); + }); }()); /*--------------------------------------------------------------------------*/