Are there any alternatives to `runBlockingTest` or...
# multiplatform
s
Are there any alternatives to
runBlockingTest
or
runTest
for running suspend tests in a Kotlin/Wasm (wasmJs) target? For js I'm doing following and its working fine: in commonTest:
expect fun runTest(block: suspend () -> Unit)
in jsTest:
Copy code
actual fun runTest(block: suspend () -> Unit): dynamic = GlobalScope.promise { block() }
This is not working for wasmJs because
dynamic
is not supported in wasmJs.
r
There's a
runTest
defined in kotlinx-coroutines-test that you can use from wasm on the most recent version.