https://github.com/tkers/enzyme-redux-helpers
👩🔬 Enzyme helpers for testing Redux connected components
https://github.com/tkers/enzyme-redux-helpers
Last synced: 4 months ago
JSON representation
👩🔬 Enzyme helpers for testing Redux connected components
- Host: GitHub
- URL: https://github.com/tkers/enzyme-redux-helpers
- Owner: tkers
- Created: 2018-01-29T19:08:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T22:03:35.000Z (over 7 years ago)
- Last Synced: 2025-02-14T22:36:26.266Z (4 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Enzyme Redux helpers
Enzyme helpers for testing Redux connected components.## Installation
Using Yarn:
```
yarn add enzyme-redux-helpers -D
```Using npm:
```
npm install enzyme-redux-helpers --save-dev
```### Requirements
Requires [Enzyme](https://github.com/airbnb/enzyme) 3.0.0+ as a peer dependency to work.## Usage
```js
import { connectedMount } from 'enzyme-redux-helpers'describe('', () => {
it('renders correctly using the passed state', () => {
const mockStore = createMockReduxStore({ state: 'foo' })
const wrapper = connectedMount(, mockStore);
// expect(wrapper.find(SubComponent)).to.have.length(1);
});
```## API
This package contains the following methods as named exports:
### connectedMount(node, store)
Returns the Enzyme wrapper instance for the mounted React element.