8000 Add other realm maps/sets tests for `_.size`. · lodash/lodash@24cef1a · GitHub
[go: up one dir, main page]

Skip to content

Commit 24cef1a

Browse files
committed
Add other realm maps/sets tests for _.size.
1 parent 5fe373f commit 24cef1a

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

test/test.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19115,30 +19115,34 @@
1911519115
});
1911619116

1911719117
QUnit.test('should work with maps', function(assert) {
19118-
assert.expect(1);
19118+
assert.expect(2);
1911919119

1912019120
if (Map) {
19121-
var map = new Map;
19122-
map.set('a', 1);
19123-
map.set('b', 2);
19124-
assert.strictEqual(_.size(map), 2);
19121+
lodashStable.each([new Map, realm.map], function(map) {
19122+
map.set('a', 1);
19123+
map.set('b', 2);
19124+
assert.strictEqual(_.size(map), 2);
19125+
map.clear();
19126+
});
1912519127
}
1912619128
else {
19127-
skipAssert(assert);
19129+
skipAssert(assert, 2);
1912819130
}
1912919131
});
1913019132

1913119133
QUnit.test('should work with sets', function(assert) {
19132-
assert.expect(1);
19134+
assert.expect(2);
1913319135

1913419136
if (Set) {
19135-
var set = new Set;
19136-
set.add(1);
19137-
set.add(2);
19138-
assert.strictEqual(_.size(set), 2);
19137+
lodashStable.each([new Set, realm.set], function(set) {
19138+
set.add(1);
19139+
set.add(2);
19140+
assert.strictEqual(_.size(set), 2);
19141+
set.clear();
19142+
});
1913919143
}
1914019144
else {
19141-
skipAssert(assert);
19145+
skipAssert(assert, 2);
1914219146
}
1914319147
});
1914419148

0 commit comments

Comments
 (0)
0