Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions packages/equality/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,38 @@ describe("equality", function () {
assertNotEqual(foo, bar)
});

it('should work with proxies mixed into the objects', function() {
const foo = {
name: 'foo',
objectThing: {
property: 'stuff',
array: [
'apples',
'oranges',
'grapes'
]
},
};

const bar = {
name: 'foo',
objectThing: new Proxy({
property: 'stuff',
array: [
'apples',
'oranges',
'grapes'
]
}, {
get(target, prop, receiver) {
return prop in target ? target[prop as keyof typeof target] : 'bad_prop';
},
})
};

assertEqual(foo, bar);
});

describe("performance", function () {
const limit = 1e6;
this.timeout(20000);
Expand Down