Add fp.invokeArgs.

This commit is contained in:
John-David Dalton
2016-03-13 16:20:12 -07:00
parent f3279b7ee1
commit 65fd579ed2
2 changed files with 37 additions and 7 deletions

View File

@@ -393,8 +393,9 @@
assert.expect(1);
var funcMethods = [
'after', 'ary', 'before', 'bind', 'bindKey', 'curryN', 'debounce', 'delay',
'overArgs', 'partial', 'partialRight', 'rearg', 'throttle', 'wrap'
'after', 'ary', 'before', 'bind', 'bindKey', 'curryN', 'debounce',
'delay', 'overArgs', 'partial', 'partialRight', 'rearg', 'throttle',
'wrap'
];
var exceptions = _.difference(funcMethods.concat('matchesProperty'), ['cloneDeepWith', 'cloneWith', 'delay']),
@@ -1143,6 +1144,32 @@
/*--------------------------------------------------------------------------*/
QUnit.module('fp.invoke');
(function() {
QUnit.test('should not accept an `args` param', function(assert) {
assert.expect(1);
var actual = fp.invoke('toUpperCase')('a');
assert.strictEqual(actual, 'A');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.invokeArgs');
(function() {
QUnit.test('should accept an `args` param', function(assert) {
assert.expect(1);
var actual = fp.invokeArgs('concat')('a')(['b', 'c']);
assert.strictEqual(actual, 'abc');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('fp.iteratee');
(function() {