Package-level declarations

Types

Link copied to clipboard
class CoThunkTester<State>(val thunk: CoThunk<State>, val initialState: State, val initialClosure: DispatchClosure = EmptyDispatchClosure, val strict: Boolean = true)

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

Link copied to clipboard

The scope for a suspending thunk under test.

Link copied to clipboard
class ThunkTester<State>(val thunk: Thunk<State>, val initialState: State, val initialClosure: DispatchClosure = EmptyDispatchClosure, val strict: Boolean = true)

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

Link copied to clipboard

The scope for a thunk under test.

Functions

Link copied to clipboard
fun <State> CoThunkTestScope(thunk: CoThunk<State>, initialState: State, initialClosure: DispatchClosure = EmptyDispatchClosure, initialOnDispatch: MutableDispatchScope<State>.(Action) -> Unit = { }): CoThunkTestScope<State>
Link copied to clipboard
inline fun <T> CoThunk<T>.test(initialState: T, initialClosure: DispatchClosure = EmptyDispatchClosure, strict: Boolean = true, block: CoThunkTestScope<T>.() -> Unit)

Creates a CoThunkTester with given parameters and runs a single CoThunkTester.test.

inline fun <T> Thunk<T>.test(initialState: T, initialClosure: DispatchClosure = EmptyDispatchClosure, strict: Boolean = true, block: ThunkTestScope<T>.() -> Unit)

Creates a ThunkTester with given parameters and runs a single ThunkTester.test.

Link copied to clipboard
fun <State> CoThunk<State>.tester(initialState: State, initialClosure: DispatchClosure = EmptyDispatchClosure, strict: Boolean = true): CoThunkTester<State>

Creates a CoThunkTester for this thunk with initialState, initialClosure and strict.

fun <State> Thunk<State>.tester(initialState: State, initialClosure: DispatchClosure = EmptyDispatchClosure, strict: Boolean = true): ThunkTester<State>

Creates a ThunkTester for this thunk with initialState, initialClosure and strict.

Link copied to clipboard
fun <State> ThunkTestScope(thunk: Thunk<State>, initialState: State, initialClosure: DispatchClosure = EmptyDispatchClosure, initialOnDispatch: MutableDispatchScope<State>.(Action) -> Unit = { }): ThunkTestScope<State>