I have
private val testCoroutineDispatcher = TestCoroutineDispatcher()
private val testCoroutineScope = TestCoroutineScope(testCoroutineDispatcher)
I try to run suspend function in it
fun runBlockingTest(block: suspend TestCoroutineScope.() -> Unit) =
testCoroutineScope.runBlockingTest { block() }
And particular is
dispatcherRule.runBlockingTest {
val msg = Gallery.Effects.LoadGallery.run.invoke(this, Gallery.Deps(photoGalleryManager))
assertThat(msg).isEqualTo(Gallery.Msg.FilesLoaded(failure))
}
I’m getting
This job is not completed yet
Even if I change it to:
private val testCoroutineScope = TestCoroutineScope(testCoroutineDispatcher + Job())
I still get that exception, what can I do?
If I run test inside the global scope then test pass