How can I get the arguments called in jest mock function?
I want to inspect the object that is passed as argument.
Advertisement
Answer
Just use mockObject.calls. In my case I used:
JavaScript
x
2
1
const call = mockUpload.mock.calls[0][0]
2
Here’s the documentation about the mock
property