Testing connected components with enzyme

后端 未结 2 425
青春惊慌失措
青春惊慌失措 2021-01-27 13:06

I am learning taking this testing course to test connected components by setting up a store factory test helper that \'creates a store for testing that matches the

2条回答
  •  后悔当初
    2021-01-27 13:32

    Solution: I forgot the browser parameter for my root reducer, given I was using connected-react-router.

    import rootReducer from 'reducers/rootReducer';
    import {createBrowserHistory} from 'history';
    
    
    export const storeFactory = (initialState) => createStore(rootReducer(createBrowserHistory()), initialState);
    

提交回复
热议问题