What libraries do you guys use for testing modern ...
# android
n
What libraries do you guys use for testing modern Kotlin apps? I tried using Junit5 and MockK, while junit5 seems rather okay, the MockK seems horrible, outdated. EDIT: Use 1.9.3 version of MockK and it works fine
a
I haven’t seen any deprecation with Mockk, been using Junit4 and Mockk for Android dev and they work fine.
n
I've been using Junit5 tho. Might check it out. But how do you mock a suspend fun without coEvery? (That is deprecated). Their docs only mention this https://mockk.io/#coroutines While using it gets you an error
Copy code
java.lang.NoClassDefFoundError: kotlinx/coroutines/experimental/BuildersKt
Idk I might be doing something wrong but haven't found any answers in their docs nor online. @antoniomarin
a
I use also strikt for assertions. And do my best to not use mockk 😉
w
Mockk is supposed to have Kotlin-friendly API, but since it PowerMock-like functionality under the hood it’s much slower than plain Mockito with Mockito-Kotlin (which I use without issues), see https://github.com/mockk/mockk/issues/13
👍 1