Package Exports
- redux-mock-store
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redux-mock-store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
redux-mock-store
A mock store for your testing your redux async action creators and middleware
Install
npm install redux-mock-store --save-devHow to use
// actions.test.js
import configureStore from 'redux-mock-store';
const middlewares = []; // add your middlewares like `redux-thunk`
const mockStore = configureStore(middlewares);
// Test in mocha
it('should dispatch action', (done) => {
const getState = {}; // initial state of the store
const action = { type: 'ADD_TODO' };
const expectedActions = [action];
const store = mockStore(getState, expectedActions, done);
store.dispatch(action);
})License
MIT