UNPKG

reducer-tester

Version:
21 lines (20 loc) 979 B
import { Action as ReduxAction, AnyAction, Reducer } from 'redux'; /** * Definition of options for `reducerTester` function * * @param TesterOption - Available options for testing reducer. * @property tests - Array of Actions. * @property reducer - The reducer function going to be tested. * @property state - Redux State, should be the same type as the argument of reducer function which provided before. * @property {optional} initialTest - Tells reducerTester if this test is testing initial state. * @property {optional} titlePrefix - Set prefix for each action snapshots. otherwise snapshot title will be just action type. */ declare type TesterOption<State = any, Action extends ReduxAction = AnyAction> = { tests: Action[]; reducer: Reducer<State, Action>; state: State; initialTest?: boolean; titlePrefix?: string; }; export default function reducerTester({ tests, reducer, state, initialTest, titlePrefix, }: TesterOption): void; export {};