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

Include TestUtils with production version of react #5649

Closed
jlongster opened this issue Dec 11, 2015 · 4 comments
Closed

Include TestUtils with production version of react #5649

jlongster opened this issue Dec 11, 2015 · 4 comments

Comments

@jlongster
Copy link
Contributor

At Mozilla, our testing infrastructure for Firefox forces us to use a "production" build of Firefox that represents an exact build of Nightly that a user would use. The problem with this and that it uses a production version of React, which does not have TestUtils included, and we need that to run our JS tests.

Is there any reason other than JS code size that it is only included in the dev version? If we just forcefully include TestUtils with our production version of React, will that work? I'm fine with doing a custom build for that.

Right now we had to switch to only use the dev version but I want to fix this ASAP.

@zpao
Copy link
Member

zpao commented Dec 11, 2015

If we just forcefully include TestUtils with our production version of React, will that work?

I think so. I can't think of anything off the top of my head that is reaching into dev-only internals.

@jlongster
Copy link
Contributor Author

Cool, thanks! My coworker also thought about just building ReactTestUtils.js into a separate lib as well, which would probably be easier. I think we'll try that out.

I'll leave this issue open until it's resolved for us. Having more options for this kind of stuff would be great.

@markboyall
Copy link

This is a problem for us as well- we'd like the free performance boost and other benefits of the production build, but can't use it because we can't run our unit tests.

@gaearon
Copy link
Collaborator

gaearon commented Oct 3, 2017

I’ll close this as stale. In 15, you could certainly run TestUtils in production mode if you wanted to, but you’d need to bundle React yourself (with CommonJS). For obvious reasons we can’t just include it in a production build we ship to everyone.

In 16 this actually regressed but we’re tracking that in #10938.

@gaearon gaearon closed this as completed Oct 3, 2017
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

No branches or pull requests

4 participants