Skip to content
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

Written a React recipe (with an example) #462

Closed
wants to merge 1 commit into from

Conversation

tomazzaman
Copy link

No description provided.

@sindresorhus
Copy link
Member

Can you add it to the readme: https://github.com/sindresorhus/ava#recipes

@vadimdemedes
Copy link
Contributor

I think this recipe should focus strictly on React + AVA, without explaining version history, react code, etc. Examples of that:

Could you please put more explanatory text in the recipe? I also noticed a few code suggestions, they should be listed below.

Thanks for your contribution and looking forward to merge this into master!

return <span />;
};

FieldError.propTypes = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary for the demo

@tomazzaman
Copy link
Author

Sure, I'll make the necessary fixes. How does this work, do I close the PR, fix the code then resubmit? (Sorry if these questions seems silly, as I said, I'm a noob at contributing in this manner :))

@sindresorhus
Copy link
Member

@tomazzaman No, you never need to resubmit the PR. Just push additional commits. See this guide: https://github.com/RichardLitt/docs/blob/master/amending-a-commit-guide.md

@tomazzaman
Copy link
Author

Thanks for the guidance!

@@ -0,0 +1,69 @@
# React testing

With 0.10.0, AVA stopped including your `.babelrc` (for reasons outlined in [this PR](https://github.com/sindresorhus/ava/pull/398)), which means you can't use JSX in your test/spec files. Note that this doesn't apply to your source files, they can still be written in JSX!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that there is soon to be a release that allows you to specify a .babelrc to use or some way to configure babel yourself. Is this not true?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are pretty close to agreement on how it should look. But the implementation is not written yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of future-proofing this documentation, a reference to the relevant issue might be helpful here. Can't seem to find it right now though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MoOx
Copy link

MoOx commented Feb 9, 2016

@tomazzaman Maybe we should use in the example import { createRenderer } from "react-addons-test-utils" with const renderer = createRenderer(); renderer.render(... ? It's the prefered way to test React components at the moment.

@sindresorhus
Copy link
Member

@tomazzaman Would you be able to finish this? :)

@sindresorhus
Copy link
Member

Closing for lack of activity. This is pretty moot now anyways as we finally have a solution for the Babel mess #573.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants