diff --git a/packages/expect/src/__tests__/matchers.test.js b/packages/expect/src/__tests__/matchers.test.js index ad70c847e934..b57c29447d9b 100644 --- a/packages/expect/src/__tests__/matchers.test.js +++ b/packages/expect/src/__tests__/matchers.test.js @@ -285,6 +285,10 @@ describe('.toStrictEqual()', () => { expect([{a: undefined}]).not.toStrictEqual([{}]); }); + it('does not ignore keys with undefined values deep inside an object', () => { + expect([{a: [{a: undefined}]}]).not.toStrictEqual([{a: [{}]}]); + }); + it('passes when comparing same type', () => { expect({ test: new TestClassA(1, 2),