-
I am trying to write some verification blocks in a shared used way, and I am having trouble verifying how many times a function gets called so I wanted to reset invocations but the only way to do that seems to be resetting the entire mock. Is there a way do this without having to re-stub the methods every time? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Not sure what you are trying to achieve, but as a general rule of thumb sharing states between tests is not a good idea, test should be completely independent on one another. Can you please post a more complete example of the behavior you are trying to achieve? |
Beta Was this translation helpful? Give feedback.
-
I would like this feature too. Chrostoq has provided a solution, but it would be nice if this existed as a |
Beta Was this translation helpful? Give feedback.
You should be able to do this by calling
clearMocks
and set all parameters butrecordedCalls
to false