Skip to content
Advertisement

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

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

Here’s the documentation about the mock property

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement