From 209aacf812d66355654102b2be98c923e38f3abc Mon Sep 17 00:00:00 2001 From: Travis Date: Wed, 15 Feb 2023 12:41:15 -0800 Subject: [PATCH] failing proxy test for demo --- packages/equality/src/tests.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/packages/equality/src/tests.ts b/packages/equality/src/tests.ts index 618efbc1..ae7c36ea 100644 --- a/packages/equality/src/tests.ts +++ b/packages/equality/src/tests.ts @@ -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);