redux-test-reducer
redux-test-reducer is a simple module that allows you to cleanly test your Redux reducers.
Installation
$ npm install --save-dev redux-test-reducer
Usage
This package works with any JavaScript testing framework. Here's an example with Mocha:
var testReducer = ; // Simple counter reducer from the redux docsvar { if actiontype === 'INCREMENT' return state + 1; else if actiontype === 'DECREMENT' return state - 1; else return state; } // Load the reducer to create an assertion functionvar assertReducer = ; ;
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new pull request