Skip to content

Latest commit

 

History

History

test

Testing

Maven Central Version

You can test you Store and Reducers using build-in functions testReducer and testStoreReducer.

Testing DSL

It is more convenient to use build-in DSL TestReducerDslBuilder to describe expected behavior of the store.

Let's take a look to the example:

testReducer(
    initialState = State.Init(false),
    reducer = AuthFeature.Reducer
) {
    Msg.Init returns State.Init(inProgress = true) + Eff.LoadCachedData
    Msg.LoadCacheAuthResult(null) returns State.NotAuthorized.Idle
}