0.1.0 • Published 8 years ago

react-test-utilities v0.1.0

Weekly downloads
4
License
ISC
Repository
-
Last release
8 years ago

react-test-utilities

Testing utilities for react.

npm install --save-dev react-test-utilities

renderAndFind(Component)

Renders a component into dom and returns that node.

var dom = renderAndFind(<Component/>);
expect(dom.text).toBe('Hello World.');

stubRouterContext(Component, props, stubs)

Stubs react-router's this.router.context so you can test components that rely on it.

import someReactRouterDependantComponent from 'components/someReactRouterDependantComponent';

var Subject = stubRouterContext(someReactRouterDependantComponent); 
var dom = renderAndFind(<Subject/>);
expect(someAssertion).toBe(true);
0.1.0

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago