TestStore<State, Action, Environment> constructor
TestStore<State, Action, Environment> (})
Creates a test store with the given initialState, reducer, and
environment.
If skipInitialState is true, the initial state is not recorded
in states.
Implementation
TestStore(
State initialState,
Reducer<State, Action, Environment> reducer,
Environment environment, {
bool skipInitialState = false,
}) {
_store = Store.initial(
initialState,
Reducer<State, Action, Environment>(
reduce: (state, action, env) {
actions.add(action);
return reducer.reduce(state, action, env);
},
),
environment,
);
_store.stateObservable.listen((e) => states.add(e), fireImmediately: !skipInitialState);
}