Add fp.flatMapDepth test.

This commit is contained in:
John-David Dalton
2016-03-06 19:13:43 -08:00
parent c16e64cd36
commit 230c18d5d6

View File

@@ -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) {