mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17: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) {
|
||||
assert.expect(1);
|
||||
assert.expect(2);
|
||||
|
||||
if (Map) {
|
||||
var map = new Map;
|
||||
map.set('a', 1);
|
||||
map.set('b', 2);
|
||||
assert.strictEqual(_.size(map), 2);
|
||||
lodashStable.each([new Map, realm.map], function(map) {
|
||||
map.set('a', 1);
|
||||
map.set('b', 2);
|
||||
assert.strictEqual(_.size(map), 2);
|
||||
map.clear();
|
||||
});
|
||||
}
|
||||
else {
|
||||
skipAssert(assert);
|
||||
skipAssert(assert, 2);
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test('should work with sets', function(assert) {
|
||||
assert.expect(1);
|
||||
assert.expect(2);
|
||||
|
||||
if (Set) {
|
||||
var set = new Set;
|
||||
set.add(1);
|
||||
set.add(2);
|
||||
assert.strictEqual(_.size(set), 2);
|
||||
lodashStable.each([new Set, realm.set], function(set) {
|
||||
set.add(1);
|
||||
set.add(2);
|
||||
assert.strictEqual(_.size(set), 2);
|
||||
set.clear();
|
||||
});
|
||||
}
|
||||
else {
|
||||
skipAssert(assert);
|
||||
skipAssert(assert, 2);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user