https://github.com/davidkpiano/redux-test-store
Test existing stores in Redux, the easy way
https://github.com/davidkpiano/redux-test-store
Last synced: about 1 month ago
JSON representation
Test existing stores in Redux, the easy way
- Host: GitHub
- URL: https://github.com/davidkpiano/redux-test-store
- Owner: davidkpiano
- License: mit
- Created: 2016-03-29T18:07:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-08T12:44:13.000Z (over 8 years ago)
- Last Synced: 2025-03-30T10:41:30.492Z (2 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redux-test-store
Test existing stores in Redux, the easy way## Quick Start
- `npm install redux-test-store --save-dev`
- Import it:```js
import createTestStore from 'redux-test-store';import store from '../path/to/real/store';
describe('auth action creators', () => {
it('should authenticate successfully', (done) => {
let tokenSet = [{token: 1}, {token: 2}];const testStore = createTestStore(store, done);
testStore.when(actionTypes.CHANGE, (state, action) => {
assert.deepEqual(state.auth.sets, tokenSet);
});testStore.dispatch(actions.authenticate({
email: '[email protected]',
password: 'goat'
}));
});
```