I’m trying to run some Android tests, what did I miss? I have
kotlinx-coroutines-test
in my test dependencies.
Copy code
java.lang.NullPointerException
at kotlinx.coroutines.CoroutineContextKt.newCoroutineContext(CoroutineContext.kt:57)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:50)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
ribesg
05/20/2019, 10:40 AM
Oh, I found the issue. I’m testing the Presenter here, which uses the View as CoroutineScope. I’m mocking the View.
ribesg
05/20/2019, 10:42 AM
I think I need to make my Presenter implement CoroutineScope instead