mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Re-add overwritten _.isEqual unit test.
Former-commit-id: 52d4e3bc02a6fd0ac30177c9da82dec60ee6eb81
This commit is contained in:
13
test/test.js
13
test/test.js
@@ -770,10 +770,15 @@
|
|||||||
equal(_.isEqual(shadowed, {}), false);
|
equal(_.isEqual(shadowed, {}), false);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should use custom `isEqual` methods on primitives', function() {
|
test('should return `true` for like-objects from different documents', function() {
|
||||||
Boolean.prototype.isEqual = function() { return true; };
|
// ensure `_._object` is assigned (unassigned in Opera 10.00)
|
||||||
equal(_.isEqual(true, false), true);
|
if (_._object) {
|
||||||
delete Boolean.prototype.isEqual;
|
var object = { 'a': 1, 'b': 2, 'c': 3 };
|
||||||
|
equal(_.isEqual(object, _._object), true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
skipTest();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should return `false` when comparing values with circular references to unlike values', function() {
|
test('should return `false` when comparing values with circular references to unlike values', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user