There is no `runBlocking` for js hence not in comm...
# multiplatform
s
There is no
runBlocking
for js hence not in common either
🏁 1
l
so is there a work around for this in order to test the suspending functions in the common part ?
you can define your own method to run test as an expect method in common
l
thx Daniel, this is what I just did and it seems to work
in common part
Copy code
expect fun <T> runBlockingCommon(context: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> T): T
and in jvm
Copy code
actual fun <T> runBlockingCommon(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T = runBlocking(context, block)
but how it’s done in the link you posted is nicer