Add more fp tests for key methods.

This commit is contained in:
John-David Dalton
2016-01-22 23:54:40 -06:00
parent 4e35d970af
commit 880ffcb1f6

View File

@@ -779,15 +779,17 @@
var object = { 'a': 1 };
QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
assert.expect(1);
assert.expect(3);
var args;
_.each(['findKey', 'findLastKey', 'mapKeys'], function(methodName) {
var args;
var actual = fp.findKey(function() {
args || (args = _.map(arguments, _.cloneDeep));
}, object);
var actual = fp[methodName](function() {
args || (args = slice.call(arguments));
}, object);
assert.deepEqual(args, ['a'], 'fp.findKey');
assert.deepEqual(args, ['a'], 'fp.' + methodName);
});
});
}());