Package app.cash.turbine

Types

Link copied to clipboard
sealed class Event<out T>
Link copied to clipboard
interface FlowTurbine<T>

Represents active collection on a source Flow which buffers item emissions, completion, and/or errors as events for consuming.

Functions

Link copied to clipboard
suspend fun <T> Flow<T>.test(validate: suspend FlowTurbine<T>.() -> Unit)

Terminal flow operator that collects events from given flow and allows the validate lambda to consume and assert properties on them in order. If any exception occurs during validation the exception is rethrown from this method.

Link copied to clipboard
fun <T> Flow<T>.testIn(scope: CoroutineScope): FlowTurbine<T>

Terminal flow operator that collects events from given flow and returns a FlowTurbine for consuming and asserting properties on them in order. If any exception occurs during validation the exception is rethrown from this method.