test

fun <STATE : Any, SIDE_EFFECT : Any, CONTAINER_HOST : ContainerHost<STATE, SIDE_EFFECT>> CONTAINER_HOST.test(initialState: STATE, isolateFlow: Boolean = true, settings: Container.Settings = container.settings): SuspendingTestContainerHost<STATE, SIDE_EFFECT, CONTAINER_HOST>

Puts your ContainerHost into suspending test mode. Intents are intercepted and executed as suspending functions.

Allows you to test your intents in isolation. Only the intent called will actually run. Method calls on the ContainerHost beyond the first will be registered but not actually execute. This allows you to test your intents in isolation, disabling loopbacks that might make your tests too complex.

Return

A suspending test wrapper around ContainerHost.

Parameters

initialState

The state to initialize the test container with

isolateFlow

Whether the intent should be isolated

settings

Replaces the Container.Settings for this test

fun <T> Flow<T>.test(): TestFlowObserver<T>

Allows you to put a Flow into test mode.