You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many functions expect an object as input parameter. calledWith relies on strict equality. expect.objectContaining is a partial match.
Is there a way to perform a deep object comparison? Am I missing a built-in matcher, or should I create on myself?
Example:
describe("foo",()=>{it("bar",()=>{constsud=mockDeep<{test: (input: {a: number;b: string})=>number;}>();sud.test.calledWith({a: 2,b: "42"}).mockReturnValue(42);// This fails because the objects are not strictly equalexpect(sud.test({a: 2,b: "42"})).toBe(42);});});
The text was updated successfully, but these errors were encountered:
Many functions expect an object as input parameter.
calledWith
relies on strict equality.expect.objectContaining
is a partial match.Is there a way to perform a deep object comparison? Am I missing a built-in matcher, or should I create on myself?
Example:
The text was updated successfully, but these errors were encountered: