expect(result).toStrictEqual({ id: 1, name: 'Ann' })"expect(result).toStrictEqual({ id: 1, name: 'Ann' })" fails. toStrictEqual treats a key with the value undefined as different from a missing key. Here deletedAt: undefined exists in the result but not in the expected object. toStrictEqual also checks that class types match.
"expect(result).toEqual({ id: 1, name: 'Ann' })" passes. toEqual ignores properties with undefined values, at every level of the object.
Read more