turbine / app.cash.turbine / FlowTurbine / expectError

expectError

abstract suspend fun expectError(): Throwable

Assert that the next event received was an error terminating the flow. If no events have been received, this function will suspend for up to timeout.

Exceptions

AssertionError - if the next event was an item or completion.

TimeoutCancellationException - if no event was received in time.