I have this test:
it("data should NOT match expectation", ()=>{
const data = {
prop1: "foo",
prop2: undefined
}
const expectation = {
prop1: "foo"
}
expect(data).not.toEqual(expectation)
})
I am getting this error:
● @ExcludeIf() decorator › data should NOT match expectation
expect(received).not.toEqual(expected) // deep equality
Expected: not {"prop1": "foo"}
Received: {"prop1": "foo", "prop2": undefined}
32 | prop1: 'foo',
33 | }
> 34 | expect(data).not.toEqual(expectation)
| ^
35 | })
36 | it('Exludes a property from the plainToInstance object', async () => {
37 | const data: TestDto = {
It thinks they’re equal when in fact they are not.
What is the solution to this?
Please note that I don’t want to check for type match. I don’t care about it