mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Add bizarro test for _.isEmpty.
This commit is contained in:
12
test/test.js
12
test/test.js
@@ -786,7 +786,7 @@
|
||||
});
|
||||
|
||||
QUnit.test('should avoid non-native built-ins', function(assert) {
|
||||
assert.expect(6);
|
||||
assert.expect(7);
|
||||
|
||||
function message(lodashMethod, nativeMethod) {
|
||||
return '`' + lodashMethod + '` should avoid overwritten native `' + nativeMethod + '`';
|
||||
@@ -810,6 +810,14 @@
|
||||
var label = message('_.keysIn', 'Object#propertyIsEnumerable');
|
||||
assert.deepEqual(actual, ['a', 'b'], label);
|
||||
|
||||
try {
|
||||
var actual = lodashBizarro.isEmpty({});
|
||||
} catch (e) {
|
||||
actual = null;
|
||||
}
|
||||
var label = message('_.isEmpty', 'Object#propertyIsEnumerable');
|
||||
assert.strictEqual(actual, true, label);
|
||||
|
||||
try {
|
||||
actual = [
|
||||
lodashBizarro.difference([object, otherObject], largeArray),
|
||||
@@ -875,7 +883,7 @@
|
||||
assert.deepEqual(actual, [], label);
|
||||
}
|
||||
else {
|
||||
skipAssert(assert, 6);
|
||||
skipAssert(assert, 7);
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user