test
suspend fun <UiState : CircuitUiState> Presenter<UiState>.test(timeout: Duration? = null, name: String? = null, policy: SnapshotMutationPolicy<UiState> = structuralEqualityPolicy(), block: suspend CircuitReceiveTurbine<UiState>.() -> Unit)(source)
Presents this Presenter and invokes a suspend ReceiveTurbine that can be used to assert state emissions from this presenter.
Parameters
timeout
an optional timeout for the test. Defaults to 1 second (in Turbine) if undefined.
policy
a policy to controls how state changes are compared in CircuitReceiveTurbine.awaitItem.
block
the block to invoke.
See also
moleculeFlow
suspend fun <UiState : CircuitUiState> Presenter<UiState>.test(vararg locals: ProvidedValue<*>, timeout: Duration? = null, name: String? = null, policy: SnapshotMutationPolicy<UiState> = structuralEqualityPolicy(), block: suspend CircuitReceiveTurbine<UiState>.() -> Unit)(source)
Helper function to test a Presenter in a way that allows for providing dependencies via CompositionLocalProvider
Parameters
locals
Vararg of ProvidedValue to be provided to the presenter during the test
timeout
an optional timeout for the test. Defaults to 1 second (in Turbine) if undefined.
policy
a policy to controls how state changes are compared in CircuitReceiveTurbine.awaitItem.
block
the block to invoke.
See also
moleculeFlow