mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Add other realm maps/sets tests for _.size.
This commit is contained in:
28
test/test.js
28
test/test.js
@@ -19115,30 +19115,34 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('should work with maps', function(assert) {
|
QUnit.test('should work with maps', function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(2);
|
||||||
|
|
||||||
if (Map) {
|
if (Map) {
|
||||||
var map = new Map;
|
lodashStable.each([new Map, realm.map], function(map) {
|
||||||
map.set('a', 1);
|
map.set('a', 1);
|
||||||
map.set('b', 2);
|
map.set('b', 2);
|
||||||
assert.strictEqual(_.size(map), 2);
|
assert.strictEqual(_.size(map), 2);
|
||||||
|
map.clear();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipAssert(assert);
|
skipAssert(assert, 2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test('should work with sets', function(assert) {
|
QUnit.test('should work with sets', function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(2);
|
||||||
|
|
||||||
if (Set) {
|
if (Set) {
|
||||||
var set = new Set;
|
lodashStable.each([new Set, realm.set], function(set) {
|
||||||
set.add(1);
|
set.add(1);
|
||||||
set.add(2);
|
set.add(2);
|
||||||
assert.strictEqual(_.size(set), 2);
|
assert.strictEqual(_.size(set), 2);
|
||||||
|
set.clear();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skipAssert(assert);
|
skipAssert(assert, 2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user