test<T, E extends Object> static method

ReduxNotifierTester<T> test<T, E extends Object>({
  1. required ReduxNotifier<T> redux,
  2. bool runInitialAction = false,
  3. T? initialState,
})

Returns a debug version of the notifier where you can set the state directly and dispatch actions

Usage: final counter = ReduxNotifier.test( redux: Counter(), initialState: 11, );

expect(counter.state, 11); counter.dispatch(IncrementAction());

Implementation

static ReduxNotifierTester<T> test<T, E extends Object>({
  required ReduxNotifier<T> redux,
  bool runInitialAction = false,
  T? initialState,
}) {
  return ReduxNotifierTester(
    notifier: redux,
    runInitialAction: runInitialAction,
    initialState: initialState,
  );
}