https://kotlinlang.org logo
#mockk
Title
# mockk
v

Vladyslav Sitalo

09/24/2020, 7:35 PM
Hey there! Is there alternative to Mockito’s
clearInvocations
in mockk? (clear invocation log without resetting the stubbing)
t

thanksforallthefish

09/25/2020, 5:41 AM
clearAllMocks(answers = false)
should do what you ask. have a look at the other options for
clearAllMocks
as well
🙏 2
v

Vladyslav Sitalo

09/27/2020, 10:59 PM
thank you!
l

Lukas K-G

09/28/2020, 5:45 AM
You can also consider the
clearMocks
call with the same
answers= false
, which requires you to pass all mocks that should be cleared. This is a bit more forgiving when one day you want to run your tests in parallel.
43 Views