TestStore

ReduKt store for testing purposes that registers dispatched actions.

Functions

Link copied to clipboard
abstract fun dispatch(action: Action)
Link copied to clipboard
abstract fun onDispatch(block: MutableDispatchScope<State>.(Action) -> Unit)

Sets a block that will be called on every dispatch called by component under test. Each call replaces previously provided block.

Link copied to clipboard
abstract fun test(strict: Boolean? = null, block: ActionsAssertScope.() -> Unit)

Runs test with block that verifies dispatched actions with this store.

Properties

Link copied to clipboard
abstract var closure: DispatchClosure
Link copied to clipboard
abstract var currentState: State
Link copied to clipboard
abstract override val state: MutableStateFlow<State>
Link copied to clipboard
abstract val strict: Boolean

If it is true, every test call must process all ActionsAssertScope.unverified actions.