0.1.0 • Published 9 years ago

react-test-context v0.1.0

Weekly downloads
15
License
MPL-2.0
Repository
github
Last release
9 years ago

React Test Context

A tiny utility to help you test components that use React's context feature.

Example usage

const stub = require('react-test-context');
const Foo = require('./components/Foo');
const fakeContext = {name: 'Kate', height: 183};

// Create a new React class to stub your context
const FooStubbed = stub(Foo, fakeContext);

const element = React.TestUtils.renderIntoDOM(<FooStubbed someProp="whatever" />);

// This is the ref to your inner element
const ref = element.refs.baseElement;
0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago