0.2.2 • Published 5 years ago

react-better-test v0.2.2

Weekly downloads
29
License
MIT
Repository
github
Last release
5 years ago

react-better-test

Better React test utils npm version CircleCI Coverage Status


Installation

npm i -D react-better-test styled-components react-test-renderer redux react-redux react-router enzyme.

Usage

import renderer from 'react-better-test'
import 'jest-styled-components'
import Adapter from 'enzyme-adapter-react-16'
import enzyme from 'enzyme'
enzyme.configure({ adapter: new Adapter() })

// ...
expect(renderer.create(<Foo />)).toMatchSnapshot()
expect(renderer.mount(<SomeStyledComponent />)).toHaveStyleRule('color', 'blue')

See the tests for full usage examples.

TODO:

  • Finish Flow
  • Fix skipped tests

License

MIT