Ensure _.every returns false as soon as the callback result is falsey.

Former-commit-id: d5488688c4a30376999b04ba80f1551af403b516
This commit is contained in:
John-David Dalton
2012-10-28 00:28:40 -07:00
parent 4eff301db3
commit 2ad6faae3a
4 changed files with 25 additions and 4 deletions

View File

@@ -348,6 +348,16 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.every');
(function() {
test('should return `false` as soon as the `callback` result is falsey', function() {
equal(_.every([true, null, true], _.identity), false);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.extend');
(function() {
@@ -1393,6 +1403,17 @@
});
}(1, 2, 3));
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.some');
(function() {
test('should return `true` as soon as the `callback` result is truthy', function() {
equal(_.some([null, true, null], _.identity), true);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.sortBy');