Igor Yakovlev
01/02/2024, 6:21 PMkotlinx.coroutines
version 1.8.0-RC2-wasm0
for WASI
was published into the experimental repo. To be compatible with current 1.9.20 toolchain one have to wrap main function into runEventLoop
function call, like:
// main or other "root" function
fun main() = kotlinx.coroutines.runEventLoop {
GlobalScope.launch {
// suspend function call
}
}
A coroutine test, that uses ``kotlinx.coroutines.test`` can be written as usual, like:
@Test
fun myTest() = kotlinx.coroutines.test.runTest {
// suspend function call
}
bashor
01/02/2024, 6:38 PMhfhbd
01/02/2024, 8:55 PMIgor Yakovlev
01/03/2024, 12:55 PM