Testing: Upgrade React and Enzyme to the latest version#3079
Conversation
There was a problem hiding this comment.
I will look into it later. I added this eslint rule to hide warning.
editor/inserter/menu.js
Outdated
There was a problem hiding this comment.
This change fixes warnings in the InserterMenu component:
Warning: Expected
onMouseLeavelistener to be a function, instead got a value ofbooleantype.
Warning: ExpectedonMouseEnterlistener to be a function, instead got a value ofbooleantype.
e3e6eb2 to
54e3057
Compare
test/setup-test-framework.js
Outdated
| "mousetrap": "1.6.1", | ||
| "prop-types": "15.5.10", | ||
| "react": "15.6.1", | ||
| "react": "16.0.0", |
|
Noting that many of our dependencies define a React peer in the 15.x line, so warnings are logged when installing a new version of a package: I imagine at least some of these should have updated versions available which define React 16 as a valid peer. |
|
Yes, we can upgrade them after release v1.5. We are using the latest React and React DOM for some time with the bundled code so it seemed like an easier migration path. I can open a follow-up PR on Monday. Thanks for catching this. @youknowriad left a note about this in the preceding PR but I forget to copy it. |
Description
Another attempt to upgrade React and Enzyme to the latest version. We started exploration in #2813 and this PR should finally make it happen. All tests work as expected.
As part of this diff I also improved the behavior of throwing an error when test executes
console.error. I provided new logic which uses spies andexpectcall to validate if test should fail. New output looks as follow:It's much easier to read and it properly outputs all warnings and errors.
There are still 2 skipped tests. I will take a closer look at them later and decide if we can fix them or they should be removed.
How Has This Been Tested?
Travis should be happy.
Run
npm testlocally.To test new behavior around
console.errorandconsole.warnsimply put such call in one of the tests.Checklist: