mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Add non-function constructor tests for _.isMap, _.isSet, and _.isWeakMap.
This commit is contained in:
39
test/test.js
39
test/test.js
@@ -9972,6 +9972,19 @@
|
||||
assert.strictEqual(_.isMap(weakMap), false);
|
||||
});
|
||||
|
||||
QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var values = [true, false],
|
||||
expected = lodashStable.map(values, alwaysFalse);
|
||||
|
||||
var actual = lodashStable.map(values, function(value) {
|
||||
return _.isMap({ 'constructor': value });
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
QUnit.test('should work with maps from another realm', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -11092,6 +11105,19 @@
|
||||
assert.strictEqual(_.isSet(weakSet), false);
|
||||
});
|
||||
|
||||
QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var values = [true, false],
|
||||
expected = lodashStable.map(values, alwaysFalse);
|
||||
|
||||
var actual = lodashStable.map(values, function(value) {
|
||||
return _.isSet({ 'constructor': value });
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
QUnit.test('should work with weak sets from another realm', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -11384,6 +11410,19 @@
|
||||
assert.strictEqual(_.isWeakMap(symbol), false);
|
||||
});
|
||||
|
||||
QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var values = [true, false],
|
||||
expected = lodashStable.map(values, alwaysFalse);
|
||||
|
||||
var actual = lodashStable.map(values, function(value) {
|
||||
return _.isWeakMap({ 'constructor': value });
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, expected);
|
||||
});
|
||||
|
||||
QUnit.test('should work with weak maps from another realm', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user