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
antoniomarin
02/25/2020, 11:22 AM
I haven’t seen any deprecation with Mockk, been using Junit4 and Mockk for Android dev and they work fine.
n
Nikola Milovic
02/25/2020, 11:39 AM
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
Idk I might be doing something wrong but haven't found any answers in their docs nor online.
@antoniomarin
a
Adam Szadkowski
02/25/2020, 11:48 AM
I use also strikt for assertions. And do my best to not use mockk 😉
w
wasyl
02/25/2020, 2:59 PM
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