mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Cleanup _.isLengh tests.
This commit is contained in:
34
test/test.js
34
test/test.js
@@ -571,8 +571,7 @@
|
|||||||
basePath = path.dirname(filePath);
|
basePath = path.dirname(filePath);
|
||||||
|
|
||||||
if (isModularize && !(amd || isNpm)) {
|
if (isModularize && !(amd || isNpm)) {
|
||||||
lodashStable.each(['internal/baseEach', 'internal/isIndex',
|
lodashStable.each(['internal/baseEach', 'internal/isIndex', 'internal/isIterateeCall'], function(relPath) {
|
||||||
'internal/isIterateeCall'], function(relPath) {
|
|
||||||
var func = require(path.join(basePath, relPath)),
|
var func = require(path.join(basePath, relPath)),
|
||||||
funcName = path.basename(relPath);
|
funcName = path.basename(relPath);
|
||||||
|
|
||||||
@@ -8573,26 +8572,31 @@
|
|||||||
|
|
||||||
QUnit.module('lodash.isLength');
|
QUnit.module('lodash.isLength');
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
QUnit.module('isLength');
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
QUnit.test('should return `true` for lengths', function(assert) {
|
QUnit.test('should return `true` for lengths', function(assert) {
|
||||||
assert.expect(3);
|
assert.expect(1);
|
||||||
|
|
||||||
assert.strictEqual(_.isLength(0), true);
|
var values = [0, 3, MAX_SAFE_INTEGER],
|
||||||
assert.strictEqual(_.isLength(3), true);
|
expected = lodashStable.map(values, lodashStable.constant(true));
|
||||||
assert.strictEqual(_.isLength(MAX_SAFE_INTEGER), true);
|
|
||||||
|
var actual = lodashStable.map(values, function(value) {
|
||||||
|
return _.isLength(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('should return `false` for non-lengths', function(assert) {
|
QUnit.test('should return `false` for non-lengths', function(assert) {
|
||||||
assert.expect(4);
|
assert.expect(1);
|
||||||
|
|
||||||
assert.strictEqual(_.isLength(-1), false);
|
var values = [-1, '1', 1.1, MAX_SAFE_INTEGER + 1],
|
||||||
assert.strictEqual(_.isLength('1'), false);
|
expected = lodashStable.map(values, lodashStable.constant(false));
|
||||||
assert.strictEqual(_.isLength(1.1), false);
|
|
||||||
assert.strictEqual(_.isLength(MAX_SAFE_INTEGER + 1), false);
|
var actual = lodashStable.map(values, function(value) {
|
||||||
|
return _.isLength(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.deepEqual(actual, expected);
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user