testRunBlocking

actual fun testRunBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> Unit): TestResult

Runs block as the body of a test and returns a TestResult that the Kotlin test framework awaits: it blocks until completion on JVM/Native, and returns the backing Promise on js/wasmJs (which is single-threaded and cannot block). Returning the result from a @Test function is what lets suspending tests actually run on the JS family, rather than firing-and-forgetting as a bare com.splendo.kaluga.base.runBlocking would.

Parameters

context

the context of the coroutine. The default value is an event loop on the current thread.

block

the test body.

actual fun testRunBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> Unit): TestResult

Runs block as the body of a test and returns a TestResult that the Kotlin test framework awaits: it blocks until completion on JVM/Native, and returns the backing Promise on js/wasmJs (which is single-threaded and cannot block). Returning the result from a @Test function is what lets suspending tests actually run on the JS family, rather than firing-and-forgetting as a bare com.splendo.kaluga.base.runBlocking would.

Parameters

context

the context of the coroutine. The default value is an event loop on the current thread.

block

the test body.

expect fun testRunBlocking(context: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> Unit): TestResult

Runs block as the body of a test and returns a TestResult that the Kotlin test framework awaits: it blocks until completion on JVM/Native, and returns the backing Promise on js/wasmJs (which is single-threaded and cannot block). Returning the result from a @Test function is what lets suspending tests actually run on the JS family, rather than firing-and-forgetting as a bare com.splendo.kaluga.base.runBlocking would.

Parameters

context

the context of the coroutine. The default value is an event loop on the current thread.

block

the test body.

actual fun testRunBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> Unit): TestResult

Runs block as the body of a test and returns a TestResult that the Kotlin test framework awaits: it blocks until completion on JVM/Native, and returns the backing Promise on js/wasmJs (which is single-threaded and cannot block). Returning the result from a @Test function is what lets suspending tests actually run on the JS family, rather than firing-and-forgetting as a bare com.splendo.kaluga.base.runBlocking would.

Parameters

context

the context of the coroutine. The default value is an event loop on the current thread.

block

the test body.

actual fun testRunBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> Unit): TestResult

Runs block as the body of a test and returns a TestResult that the Kotlin test framework awaits: it blocks until completion on JVM/Native, and returns the backing Promise on js/wasmJs (which is single-threaded and cannot block). Returning the result from a @Test function is what lets suspending tests actually run on the JS family, rather than firing-and-forgetting as a bare com.splendo.kaluga.base.runBlocking would.

Parameters

context

the context of the coroutine. The default value is an event loop on the current thread.

block

the test body.

actual fun testRunBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> Unit): TestResult

Runs block as the body of a test and returns a TestResult that the Kotlin test framework awaits: it blocks until completion on JVM/Native, and returns the backing Promise on js/wasmJs (which is single-threaded and cannot block). Returning the result from a @Test function is what lets suspending tests actually run on the JS family, rather than firing-and-forgetting as a bare com.splendo.kaluga.base.runBlocking would.

Parameters

context

the context of the coroutine. The default value is an event loop on the current thread.

block

the test body.