All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jsTest.RunTest.kt Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.promise
import kotlin.js.Promise

actual fun  block(body: suspend CoroutineScope.() -> T): dynamic = runTestInternal(block = body)

fun  runTestInternal(
    block: suspend CoroutineScope.() -> T
): Promise {
    val promise = GlobalScope.promise {
        return@promise block()
    }
    return promise
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy