jean
09/15/2021, 7:16 AMkotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
when running the same test for ios.
this is my BaseTest class in iosTest
actual abstract class BaseTest {
@OptIn(DelicateCoroutinesApi::class)
actual fun <T> runTest(block: suspend CoroutineScope.() -> T) {
var error: Throwable? = null
GlobalScope.launch(Dispatchers.Main) {
try {
block()
} catch (t: Throwable) {
error = t
} finally {
CFRunLoopStop(CFRunLoopGetCurrent())
}
}
CFRunLoopRun()
error?.also { throw it }
}
}
I just copied what they have. Any idea what I’m doing wrong?andylamax
09/15/2021, 8:18 AMjean
09/15/2021, 8:57 AMDispatchers.Default
instead seems to workOsman Saral
09/15/2021, 11:49 AMandylamax
09/15/2021, 12:41 PMleandro
09/15/2021, 7:09 PM1.5.1-native-mt