-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support react-dom/test-utils #875
Comments
Actually, it looks like more than just a convenience thing, I'm now getting these warnings in any test that uses enzyme:
So I think we'll want to get on this ASAP. I'm looking into it now. Any tips are appreciated because I don't know this codebase at all... |
We definitely need to fix this ASAP; React doesn't consider warnings semver-major, but any responsible developer makes console warnings and errors fail their tests, so this will affect many. |
I think I've got something. PR coming soon. Fun story, I've found something else too with |
Actually, I think I'll just tag this all as v15.5 fixes and do it in one. |
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
PR open here: #876 |
Just chiming in here because I started seeing the errors today, does this one have to do with React moving createClass to it's own package as well?
|
Yes, my pull request fixes that in enzyme. Though a bunch of other libs will need to update as well... |
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
A few deprecation warnings were added in [email protected]. This supports the new APIs that React recommends. Closes enzymejs#875
So I need to upgrade to react 15.5 to clear this message? |
No. If you upgrade to react 15.5 then you will start seeing this message. The only way to get the message to go away is to remove all uses of |
@rhinoceraptor You are probably missing Detection for React 15.5 uses a try-catch block which swallows the actual error ( |
I'm using create react apps, with react-scripts. When I run enzyme with jest, I still get this output ... am I missing something? Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning. |
CRA may have been updated already, but you need to have |
@kentcdodds can you explain more about your comment? All of my tests that are using a library on |
@juliacochran it's not that you need to load |
Workaround for me was to install react-test-renderer as dev dependency and errors was gone |
For me, I remove |
I'm using [email protected], I have also installed [email protected]、[email protected], the warning persists, what else should I do? |
@kimjuny all react-* versions should match; try v15.4.2 of react-addons-test-utils also. |
@ljharb that fixed my problem 👌 |
@OscarBarrett Thanks, solved for me as well. |
Ensuring all version numbers match is what fixed it for me |
although react-addons-test-utils is deprecated for version 15.5.4 |
From https://www.npmjs.com/package/react-addons-test-utils:
When trying to NPM install v15.5.2 exactly I get:
How are you guys getting 15.5.2 installed? |
I can confirm @jetpack3331 suggestion does the trick. |
good~ |
I've just started using enzyme and discovered that the installation instructions from the enzyme docs does not contain the heads up on missing the react-test-renderer dependency. Navigating to the project's README isn't too hard but I thought it could be a nuisance to some people. (I apologize if the docs I was referring to was wrong) |
Note, you should follow the installation instructions for your version of React, and ensure, if you're installing |
I'm not sure why I'm getting this warning since I haven't found any references in my project:
|
@nemanjacosovic make sure you’re using enzyme 3.2, the right version of react and of the right enzyme adapter. |
all you have to do is remove |
Today's announcement moves
react-addons-test-utils
toreact-dom/test-utils
. I'm not sure I understand all the intricacies of the test utils requirements from enzyme, but I expect that something may be able to be done about the requirement forreact-addons-test-utils
. Any chance this could be revisited?The text was updated successfully, but these errors were encountered: