turbine / app.cash.turbine / kotlinx.coroutines.flow.Flow

Extensions for kotlinx.coroutines.flow.Flow

test

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.

suspend fun <T> Flow<T>.test(timeout: Duration = 1.seconds, validate: suspend FlowTurbine<T>.() -> Unit): Unit