This plugin sets up
react-redux context to test components that are
connect()ed to redux.
Install via yarn or npm$> yarn add -D enzyme-context enzyme-context-redux
Add to plugins:;;;;const plugins =store:;const mount = ;const shallow = ;
After adding the plugin to your
shallow, it can be used in your tests like so:
; // import the mount created with enzyme-context;;
reduxContext(options) => EnzymePlugin
() => Store): a function which must return a redux store
EnzymePlugin: The plugin which can be passed to
;;;;const plugins =store:;const mount = ;const shallow = ;
This plugin also allows some configuration to be passed at mount-time:
Action[optional]): an array of initial actions to be dispatched before the component is mounted. Useful to get the redux state into a desired form before the component initializes.
- Example:const wrapper =;