Remove argCount from _.callback and add getCallback helper.

This commit is contained in:
John-David Dalton
2014-07-09 13:02:28 -07:00
parent 2a1e063641
commit 51ab030541
2 changed files with 109 additions and 106 deletions

View File

@@ -1927,18 +1927,7 @@
QUnit.module('lodash.callback');
(function() {
test('should provide `argCount` number of arguments to `func`', 1, function() {
var args;
var callback = _.callback(function() {
args = slice.call(arguments);
}, 1);
callback('a', 'b', 'c');
deepEqual(args, ['a']);
});
test('should work without an `argCount`', 1, function() {
test('should provide arguments to `func`', 1, function() {
var args,
expected = ['a', 'b', 'c', 'd', 'e'];