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

react-test-renderer/shallow throws if NODE_ENV===production #11055

Closed
PixnBits opened this issue Oct 2, 2017 · 3 comments
Closed

react-test-renderer/shallow throws if NODE_ENV===production #11055

PixnBits opened this issue Oct 2, 2017 · 3 comments

Comments

@PixnBits
Copy link

PixnBits commented Oct 2, 2017

Do you want to request a feature or report a bug?
Feels like a bug, open to correction/context

What is the current behavior?
react-test-renderer/shallow throws if NODE_ENV===production; more details under "which versions of React" below

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).
does NODE_ENV=production jest count? ;) jk
NODE_ENV=production jest with specs comparing snapshots of shallow rendered components utilizing libraries that change behavior when NODE_ENV=production (ex: recompose)

What is the expected behavior?
Able to shallow render components as they would/will be when built and deployed to production.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
v15.x react-test-renderer/shallow runs happily, the check and error throw appears to be new in v16.x

Related: 7231 comment had a response of

There should be no difference...between dev and prod versions of React.

which is great news in terms of react 👍 but disallowing prod version of shallow render doesn't cover the prod code path of other libraries/dependencies 🙏

@gaearon
Copy link
Collaborator

gaearon commented Oct 2, 2017

The use case sounds reasonable to me. As I mentioned in #10938 I would take a PR that makes proper production builds for them.

@aweary
Copy link
Contributor

aweary commented Oct 2, 2017

Also, let's keep the conversation in #10938. Thanks!

@aweary aweary closed this as completed Oct 2, 2017
@PixnBits
Copy link
Author

PixnBits commented Oct 2, 2017

Ah, so sorry, that issue didn't come up in my searches. Feel free to close this one in favor of #10938.

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

3 participants