enzyme-redux-helpers

0.0.1 • Public • Published

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 3.0.0+ as a peer dependency to work.

Usage

import { connectedMount } from 'enzyme-redux-helpers'

describe('<MyConnectedComponent />', () => {
  it('renders correctly using the passed state', () => {
    const mockStore = createMockReduxStore({ state: 'foo' })
    const wrapper = connectedMount(<MyComponent />, 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.

Readme

Keywords

none

Package Sidebar

Install

npm i enzyme-redux-helpers

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • lapixx