Vaibhav Jaiswal
04/30/2024, 1:18 PM<http://Dispatchers.IO|Dispatchers.IO>
in commonMain
It was there when the project only targeting android and iOS and not js(IR)
Michael Krussel
04/30/2024, 1:35 PM<http://Dispatcher.IO|Dispatcher.IO>
so you cannot use it.
Instead you will have to create some expect function or property that will return the dispatcher you want to use for IO.Vaibhav Jaiswal
04/30/2024, 1:36 PMMichael Krussel
04/30/2024, 1:36 PMMichael Krussel
04/30/2024, 1:36 PMMichael Krussel
04/30/2024, 1:39 PMVaibhav Jaiswal
04/30/2024, 1:42 PMMichael Krussel
04/30/2024, 1:42 PMVaibhav Jaiswal
04/30/2024, 1:54 PMMichael Krussel
04/30/2024, 1:55 PMrunTest
is implemented in JS.Vaibhav Jaiswal
04/30/2024, 2:20 PMMichael Krussel
04/30/2024, 2:20 PMVaibhav Jaiswal
04/30/2024, 2:20 PMMichael Krussel
04/30/2024, 2:21 PMOn JVM and Native, this function behaves similarly tohttps://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/run-test.html, with the difference that the code that it runs will skip delays. This allows to use delay in tests without causing them to take more time than necessary. On JS, this function creates arunBlocking
that executes the test body with the delay-skipping behavior.Promise
Vaibhav Jaiswal
04/30/2024, 2:32 PMexpect fun <T> runBlocking(
context: CoroutineContext = EmptyCoroutineContext,
block: suspend CoroutineScope.() -> T
): T
This returns the data of type T which is what I want
I tried using GlobalScope, but it returns a Job or a DeferredMichael Krussel
04/30/2024, 2:37 PM