redux-chaos
Dead Simple Chaos/Property Testing with Redux
This randomly chooses actions from an array 100,000 times and dispatches it to a store with hook on each repetition.
Setup
npm i --save-dev redux-chaos
(Store: ReduxStore, Actions: Array<Object | Function> | Object, Each: ?Function)
chaos Store: any redux store
Actions: your object of actions or an array of your actions
If you have an actions file, you can simply use `import * as actions from './actions' for the actions.
Each: (prevState: any, nextState: any, action: Object | Function): void
Each is executed every iteration and given the parameters above, self explanatory.
Example
{ } const mockStore = { ifactiontype === 'INCREMENT_COUNTER' tobeaboveprevStatecount ifactiontype === 'DECREMENT_COUNTER' tobebelowprevStatecount tohavelengthbelow51}
Very simple.