I'm using Typescript and Jest. In Jest, if I want to check if my function was called I can run
expect(myMockFn).toHaveBeenCalledWith(arrayArgument);
I want to check if my function was called with an array argument that contains an object with some values. For example,
expect(myMockFn).toHaveBeenCalledWith( [{x: 2, y: 3}] );
The actual call is made with a parameter that looks like
[{x: 2, y: 3, id: 'some-guid'}]
so my expect is failing because I don't have the id attribute in the first object of the array, but I would like to match and ignore the ID, since it will be different each time, even though the other arguments are the same. How do I construct such an expect call with Jest?