https://kotlinlang.org logo
Title
a

arild

09/23/2019, 1:12 PM
Could I solicit some opinions on
private val someMockedDependency: SomeClass = mockk()
vs
@MockK private lateinit var someMockedDependency: SomeClass
?
w

wbertan

09/23/2019, 1:14 PM
My 2 cents… I prefer the
= mockk()
, without the annotation, so you don’t need to “init” the AnnotationProccess, and in the tests where I use it, along the Robolectric, it was making a difference by around 6s (compared when using the
@MockK
with the “init” method)
1
a

arild

09/23/2019, 1:41 PM
👍 any thoughts on
@InjectMockKs
?
w

wbertan

09/23/2019, 1:42 PM
No 😞 (As I never used it)