Add _.support unit tests and remove _.support from the lodash underscore build.

Former-commit-id: 986c02d5363329f16cde720430b26edb6bc865f0
This commit is contained in:
John-David Dalton
2013-03-08 00:53:27 -08:00
parent 3f163051b1
commit b01d50fe05
5 changed files with 36 additions and 3 deletions

View File

@@ -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);

View File

@@ -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() {