mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
(4.17) Short circuit sortedIndexBy methods for empty arrays (#4497)
This commit is contained in:
committed by
John-David Dalton
parent
b281ddecc4
commit
602cc3f03d
10
test/test.js
10
test/test.js
@@ -20998,6 +20998,16 @@
|
||||
assert.strictEqual(actual, 1);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should avoid calling iteratee when length is 0', function(assert) {
|
||||
var objects = [],
|
||||
iteratee = function() {
|
||||
throw new Error;
|
||||
},
|
||||
actual = func(objects, { 'x': 50 }, iteratee);
|
||||
|
||||
assert.strictEqual(actual, 0);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should support arrays larger than `MAX_ARRAY_LENGTH / 2`', function(assert) {
|
||||
assert.expect(12);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user