1.1.1 • Published 10 years ago

react-testing-helpers v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

React Testing Helpers

Simple testing helpers for React.

Usage

import * as testHelpers from 'react-testing-helpers';

testingHelpers.shallowRender(jsx)

Helper to automatically shallowRender the given jsx

import {shallowRender} from 'react-testing-helpers';

const output = shallowRender(
  <MyComponent>
    <MyOtherComponent/>
  </MyComponent>
);

testingHelpers.renderFakeDom(jsx)

Helper takes jsx output from renderToString and loads it into cheerio.

This then allows for the output to be queried in a similar fashion to jQuery.

import {renderFakeDom} from 'react-testing-helpers';

const $ = shallowRender(
  <MyComponent>
    <div/>
  </MyComponent>
);

expect($('div').length).toEqual(1);

Licence

MIT

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago