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

Klitos Kyriacou

10/06/2022, 10:03 PM
I'm looking at code that's a bit bloated with unnecessary
every { ... } returns ...
, or
justRun {...}
calls. Is there a way to turn on some diagnostic that tells you about any calls to
every
or
justRun
that weren't followed by an actual call to the given mock method?
j

Jakub Gwóźdź

10/07/2022, 5:31 AM
checkUnnecessaryStub
m

Matteo Mirk

10/07/2022, 8:11 AM
or maybe declare the mocks with
relaxed = true
and remove all the unnecessary stubbings
23 Views