From 230c18d5d64f4916ea77d5230c13f64cc17df938 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 6 Mar 2016 19:13:43 -0800 Subject: [PATCH] Add `fp.flatMapDepth` test. --- test/test-fp.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/test-fp.js b/test/test-fp.js index 7f4ffaf4a..6e2e6558c 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -1035,6 +1035,27 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('fp.flatMapDepth'); + + (function() { + QUnit.test('should have an argument order of `iteratee`, `depth`, then `collection`', function(assert) { + assert.expect(2); + + function duplicate(n) { + return [[[n, n]]]; + } + + var array = [1, 2], + object = { 'a': 1, 'b': 2 }, + expected = [[1, 1], [2, 2]]; + + assert.deepEqual(fp.flatMapDepth(duplicate)(2)(array), expected); + assert.deepEqual(fp.flatMapDepth(duplicate)(2)(object), expected); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('fp.flow and fp.flowRight'); _.each(['flow', 'flowRight'], function(methodName) {