WorkerTester

interface WorkerTester<T>(source)

Properties

Link copied to clipboard
abstract val testCoroutineScheduler: TestCoroutineScheduler

Access the TestCoroutineScheduler of the kotlinx.coroutines.test.TestScope running the Worker's test.

Functions

Link copied to clipboard
abstract suspend fun assertFinished()

Suspends until the worker emits an output or finishes.

Link copied to clipboard
abstract fun assertNoOutput()

Throws an AssertionError if an output, error, or completion has been emitted since the last call to nextOutput.

Link copied to clipboard
abstract fun assertNotFinished()

Throws an AssertionError immediately if the worker is finished.

Link copied to clipboard
abstract suspend fun cancelWorker()

Cancels the worker and suspends until it's finished cancelling (joined).

Link copied to clipboard
abstract suspend fun getException(): Throwable

Suspends until the worker throws an exception, then returns it.

Link copied to clipboard
abstract suspend fun nextOutput(): T

Suspends until the worker emits its next value, then returns it.