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

Use a more sophisticated template for end-to-end testing of Create React App #706

Closed
gaearon opened this issue Sep 22, 2016 · 5 comments · Fixed by #1187
Closed

Use a more sophisticated template for end-to-end testing of Create React App #706

gaearon opened this issue Sep 22, 2016 · 5 comments · Fixed by #1187

Comments

@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

We currently test the same template we generate by default, which is probably file, but we miss out on testing more advanced features. Ideally we should have a kitchensink template that uses all possible features (JSX, Flow, NODE_PATH, generators, async/await, class properties etc), and make sure that that template builds and passes tests.

If you’d like to work on it, please write in this issue so others don’t duplicate effort. The task would consist of:

  1. Looking at tasks/e2e.sh and learning how we test CRA
  2. Figuring out how to make it use a different template just for e2e test—not sure how I’d do that so suggestions welcome
  3. Creating that kitchensink template
@gaearon
Copy link
Contributor Author

gaearon commented Sep 22, 2016

Stretch goal: use Jest snapshot testing for build output!
(You can look at Jest repo to see how Jest tests its own output with snapshots.)

@wdhorton
Copy link
Contributor

I'd like to take a crack at this

@gaearon
Copy link
Contributor Author

gaearon commented Sep 22, 2016

Cool, let me know if you stumble onto something. It’s a pretty open-ended task and will require some experimentation.

@wdhorton
Copy link
Contributor

@gaearon For getting the e2e test to use a kitchensink template, would it be ok to pass an additional flag to create-react-app (like --use-kitchensink, --e2e, or --ci), which it would pass to scripts/init.js, where the copying of template actually happens? I can't really think of another way to get init to use a different template.

@gaearon
Copy link
Contributor Author

gaearon commented Sep 24, 2016

Let’s make it --from-template <path>. We might eventually allow remote URLs there as well 😛

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

Successfully merging a pull request may close this issue.

2 participants