TestCoroutineScope

Deprecated

Use `TestScope` in combination with `runTest` instead.Please see the migration guide for details: https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/MIGRATION.md

A scope which provides detailed control over the execution of coroutines for tests.

This scope is deprecated in favor of TestScope. Please see the migration guide for an instruction on how to update the code for the new API.

Properties

Link copied to clipboard
Link copied to clipboard

The delay-skipping scheduler used by the test dispatchers running the code in this scope.

Link copied to clipboard

List of uncaught coroutine exceptions, for backward compatibility.

Functions

Link copied to clipboard

Advances the testScheduler by delayTimeMillis and runs the tasks up to that moment (inclusive).

Link copied to clipboard

Advances the testScheduler to the point where there are no tasks remaining.

Link copied to clipboard

Called after the test completes.

Link copied to clipboard

Convenience method for calling runBlockingTest on an existing TestCoroutineScope.

Link copied to clipboard

Run any tasks that are pending at the current virtual time, according to the testScheduler.

Link copied to clipboard
fun TestCoroutineScope.runTest(dispatchTimeoutMs: Long = DEFAULT_DISPATCH_TIMEOUT_MS, block: suspend TestCoroutineScope.() -> Unit): TestResult

Runs a test in a TestCoroutineScope based on this one.