MiddlewareTester

class MiddlewareTester<State>(val middleware: Middleware<State>, val initialState: State, val initialClosure: DispatchClosure = EmptyDispatchClosure, val strict: Boolean = true)

Creates a test environment for a middleware with initialState and initialClosure. If strict is true, every test call must process all MiddlewareTestScope.unverified actions.

Constructors

Link copied to clipboard
fun <State> MiddlewareTester(middleware: Middleware<State>, initialState: State, initialClosure: DispatchClosure = EmptyDispatchClosure, strict: Boolean = true)

Functions

Link copied to clipboard
inline fun test(strict: Boolean? = null, state: State = initialState, closure: DispatchClosure = EmptyDispatchClosure, block: MiddlewareTestScope<State>.() -> Unit)

Runs a middleware test from a block. Each test call initiates middleware separately.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val strict: Boolean = true