runBlockingTestDeprecated

@ExperimentalCoroutinesApi
fun TestCoroutineDispatcher.runBlockingTestDeprecated(block: suspend TestCoroutineScope.() -> Unit)

Convenience method for calling runBlockingTest on an existing TestCoroutineDispatcher.

Note: This function is intended only to support the transition period while we migrate to kotlinx-coroutines-test 1.6.x. The new API introduced in 1.6.x should be used instead.


@ExperimentalCoroutinesApi
fun runBlockingTestDeprecated(context: CoroutineContext = EmptyCoroutineContext, testBody: suspend TestCoroutineScope.() -> Unit)

Executes a testBody inside an immediate execution dispatcher. If context contains CoroutineDispatcher or CoroutineExceptionHandler, then they must implement DelayController and TestCoroutineExceptionHandler respectively. This is similar to runBlocking but it will immediately progress past delays and into launch and async blocks. You can use this to write tests that execute in the presence of calls to delay without causing your test to take extra time.

This method requires that all coroutines launched inside testBody complete, or are cancelled, as part of the test conditions. Unhandled exceptions thrown by coroutines in the test will be re-thrown at the end of the test.

Note: This function is intended only to support the transition period while we migrate to kotlinx-coroutines-test 1.6.x. The new API introduced in 1.6.x should be used instead.