How do you guys unit test suspending functions in ...
# multiplatform
m
How do you guys unit test suspending functions in KMP, when
org.jetbrains.kotlinx:kotlinx-coroutines-test
is not available for common code?
k
runBlocking
also not in common, but it exists for native/jvm at least
m
Thank you for the tip, I defined an
expect fun runBlocking
in common and added the actuals in the jvm and iOS code. Apparently it was not added to common because JS doesn't support it, but it's available on native and JVM as you said, and works this way with a custom
runBlocking
declaration in common.
k
yep!