Skip to content

Commit 6921e96

Browse files
synapseaduh95
authored andcommitted
Update test/parallel/test-assert-objects.js
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent cce5b7b commit 6921e96

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/parallel/test-assert-objects.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ describe('Object Comparison Tests', function() {
301301
const set2 = new Set(['value1', 'value3']);
302302
assert.throws(() => assert.matchObjectStrict(set1, set2), Error);
303303
});
304+
305+
it('should compare plain objects from different realms', function() {
306+
assert.matchObjectStrict(
307+
vm.runInNewContext('({ a: 1, b: 2n, c: "3", d: /4/, e: new Set([5]), f: [6], g: new Uint8Array })'),
308+
{ b: 2n, e: new Set([5]), f: [6], g: new Uint8Array() }
309+
);
310+
});
304311

305312
it('should strictly compare two objects with identical getter/setter properties', function() {
306313
const createObjectWithGetterSetter = () => {

0 commit comments

Comments
 (0)