-
Notifications
You must be signed in to change notification settings - Fork 47.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ReactTestUtils to react-tools (main.js) and document it #560
Comments
👍 |
👍 |
👍 With React's recent increase in popularity, an easy testing story is going to be more and more in demand |
In fact, would adding a |
I'll take it. I especially want to explain the new react/src/test/ReactTestUtils.js Lines 195 to 220 in 1ee7f81
|
fwiw, here's my take on what I mentioned: thomasboyt@01d53c9 |
Relevant: #745 |
For anybody running across this issue, @spicyj pointed me at http://myshareoftech.com/2013/12/unit-testing-react-dot-js-with-jasmine-and-karma.html , which includes information for shipping a vendored version of react with test utils, but also uses constructs like expect(label.refs.p).toBeDefined();
expect(label.refs.p.props.children).toBe("Some Text We Need for Test") to inspect react component state, which was the necessary piece for me. |
I have written a library called jasmine-react which I use to test react components: https://github.com/tommyh/jasmine-react. it allows you todo things like:
repost of info I put in reactjs freenode: in the long run, I might try to merge some of my features into https://github.com/facebook/react/blob/master/src/test/ReactTestUtils.js and #560. but for right now, jasmine-react works out of the box w/ no custom grunt build needed |
👍 |
This was done |
No description provided.
The text was updated successfully, but these errors were encountered: