mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Fix build test and add extra "Arrays" and "Functions" method category tests.
Former-commit-id: 924e034ec6ec8d05d573dff969f064f1bb32ea33
This commit is contained in:
@@ -214,7 +214,6 @@
|
||||
'merge',
|
||||
'omit',
|
||||
'pairs',
|
||||
'parseInt',
|
||||
'pick',
|
||||
'values'
|
||||
];
|
||||
@@ -225,6 +224,7 @@
|
||||
'identity',
|
||||
'mixin',
|
||||
'noConflict',
|
||||
'parseInt',
|
||||
'random',
|
||||
'result',
|
||||
'runInContext',
|
||||
|
||||
25
test/test.js
25
test/test.js
@@ -2944,15 +2944,32 @@
|
||||
oldDash = window._;
|
||||
|
||||
var returnArrays = [
|
||||
'at',
|
||||
'compact',
|
||||
'difference',
|
||||
'filter',
|
||||
'flatten',
|
||||
'functions',
|
||||
'initial',
|
||||
'intersection',
|
||||
'invoke',
|
||||
'keys',
|
||||
'map',
|
||||
'pairs',
|
||||
'pluck',
|
||||
'range',
|
||||
'reject',
|
||||
'rest',
|
||||
'shuffle',
|
||||
'sortBy',
|
||||
'times',
|
||||
'toArray',
|
||||
'where'
|
||||
'union',
|
||||
'uniq',
|
||||
'values',
|
||||
'where',
|
||||
'without',
|
||||
'zip'
|
||||
];
|
||||
|
||||
var funcs = _.without.apply(_, [_.functions(_)].concat([
|
||||
@@ -2970,6 +2987,7 @@
|
||||
'memoize',
|
||||
'once',
|
||||
'partial',
|
||||
'partialRight',
|
||||
'tap',
|
||||
'throttle',
|
||||
'wrap'
|
||||
@@ -2977,10 +2995,13 @@
|
||||
|
||||
_.each(funcs, function(methodName) {
|
||||
var actual = [],
|
||||
expected = _.times(falsey.length, function() { return []; }),
|
||||
func = _[methodName],
|
||||
pass = true;
|
||||
|
||||
var expected = (methodName == 'union')
|
||||
? _.map(falsey, function(value, index) { return index ? [value] : []; })
|
||||
: _.map(falsey, function() { return []; });
|
||||
|
||||
_.each(falsey, function(value, index) {
|
||||
try {
|
||||
actual.push(index ? func(value) : func());
|
||||
|
||||
Reference in New Issue
Block a user