FlowTestScope

interface FlowTestScope

This scope provides a helper startCollecting method for easier testing of Kotlin Flows.

Properties

Link copied to clipboard
abstract val scope: TestScope

Origin TestScope instance

Functions

Link copied to clipboard
open fun advanceTimeBy(millis: Long)
Link copied to clipboard
open fun advanceUntilIdle()
Link copied to clipboard
abstract fun <T> executeInBackground(context: CoroutineContext = UnconfinedTestDispatcher(scope.testScheduler), command: suspend () -> T): BackgroundCoroutineState<T>

Execute a command in the backgroundScope.

Link copied to clipboard
open fun runCurrent()
Link copied to clipboard
abstract fun <T> Flow<T>.startCollecting(context: CoroutineContext = UnconfinedTestDispatcher(scope.testScheduler)): TestFlowCollector<T>

Start collecting this flow.