addamsson
01/18/2020, 5:55 PM.join() a Job? What I have right now looks like this:
@Test
fun someTest {
myObj.doSomething().join()
}
My problem is that I can't call join() if I want to wait for the coroutine to complete because I have no CoroutineScope but there is no runBlocking in a common project which what I usually use in my jvm tests. What can I do instead to solve this problem?gcx11
01/18/2020, 6:01 PMaddamsson
01/18/2020, 6:05 PMaddamsson
01/18/2020, 6:05 PMpromise?addamsson
01/18/2020, 6:06 PMpromise from?gcx11
01/18/2020, 6:21 PMimplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$coroutines_version"
as dependency into jsTest block. And JS declaration for newer version looks like this
actual fun runTest(block: suspend () -> Unit): dynamic = GlobalScope.promise { block() }addamsson
01/18/2020, 6:23 PM