How can I get the arguments called by jest mock function?

How can I get the arguments called by jest mock function?

I want to check an object as an argument.

+15
javascript jestjs jest
source share
1 answer

Just use mockObject.calls . In my case, I used:

const call = mockUpload.mock.calls[0][0] 

Here is the mock property documentation

+27
source share

All Articles