mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Add fp.flatMapDepth test.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user