Currently, I am utilizing Jest to test the structure of an object with attributes
{cart_id: 'string', payment: 'string', site: 'string'}
. However, when I attempt the following:
test('paymentRequest should be formatted', () => {
expect(paymentRequest(paymentBody)).objectContaining({
cart_id: expect.any(String),
payment: expect.any(String),
site: expect.any(String)
})
})
An error is being thrown. I have checked the documentation but am unsure about the usage of toBeCalled with, as shown in their example here: https://facebook.github.io/jest/docs/en/expect.html#expectobjectcontainingobject