mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Add _.support unit tests and remove _.support from the lodash underscore build.
Former-commit-id: 986c02d5363329f16cde720430b26edb6bc865f0
This commit is contained in:
@@ -913,6 +913,7 @@
|
||||
strictEqual(lodash.some([false, true, false]), true, '_.some: ' + basename);
|
||||
deepEqual(lodash.times(null, function() {}), [null], '_.times should not coerce `n` to a number: ' + basename);
|
||||
equal(lodash.template('${a}', object), '${a}', '_.template should ignore ES6 delimiters: ' + basename);
|
||||
equal('support' in lodash, false, '_.support should not exist: ' + basename);
|
||||
equal('imports' in lodash.templateSettings, false, '_.templateSettings should not have an "imports" property: ' + basename);
|
||||
strictEqual(lodash.uniqueId(0), '1', '_.uniqueId should ignore a prefix of `0`: ' + basename);
|
||||
|
||||
|
||||
31
test/test.js
31
test/test.js
@@ -2244,7 +2244,6 @@
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.some');
|
||||
@@ -2329,6 +2328,36 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.support');
|
||||
|
||||
(function() {
|
||||
test('should contain properties with boolean values', function() {
|
||||
var props = [
|
||||
'argsObject',
|
||||
'argsClass',
|
||||
'enumPrototypes',
|
||||
'fastBind',
|
||||
'fastKeys',
|
||||
'ownLast',
|
||||
'nonEnumArgs',
|
||||
'nonEnumShadows',
|
||||
'spliceObjects',
|
||||
'unindexedChars',
|
||||
'nodeClass'
|
||||
];
|
||||
|
||||
_.each(props, function(prop) {
|
||||
if (_.has(_.support, prop)) {
|
||||
equal(typeof _.support[prop], 'boolean');
|
||||
} else {
|
||||
skipTest();
|
||||
}
|
||||
});
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.template');
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user