-
Notifications
You must be signed in to change notification settings - Fork 3.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
breaking: remove support for React 16 and 17 for Cypress Component Testing. Additionally, remove the cypress/react18
testing harness and merge it upstream with cypress/react
#30590
breaking: remove support for React 16 and 17 for Cypress Component Testing. Additionally, remove the cypress/react18
testing harness and merge it upstream with cypress/react
#30590
Conversation
cypress Run #58448
Run Properties:
|
Project |
cypress
|
Branch Review |
breaking/remove_react_16_17_merge_react18_harness_upstream
|
Run status |
Passed #58448
|
Run duration | 16m 59s |
Commit |
90da84a3b5: update tests / suggestions from code review [run ci]
|
Committer | AtofStryker |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
28
|
Skipped |
0
|
Passing |
764
|
View all changes introduced in this branch ↗︎ |
UI Coverage
66.27%
|
|
---|---|
Untested elements |
26
|
Tested elements |
55
|
Accessibility
96.21%
|
|
---|---|
Failed rules |
0 critical
4 serious
1 moderate
0 minor
|
Failed elements |
199
|
314c3f4
to
1f8d370
Compare
1f8d370
to
e253a15
Compare
04b374f
to
cbdb33a
Compare
e253a15
to
b4337a2
Compare
b4337a2
to
9eb53bc
Compare
npm/react/cypress/component/advanced/app-action-example/counter.cy.jsx
Outdated
Show resolved
Hide resolved
9eb53bc
to
1fb7109
Compare
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import major from 'semver/functions/major' | ||
import ReactDOM from 'react-dom/client' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copied over from cypress/react18
25fde00
to
52061c7
Compare
…d move cypress/react18 upstream into cypress/react [run ci]
52061c7
to
34043f9
Compare
*/ | ||
export function mount (jsx: React.ReactNode, options: MountOptions = {}, rerenderKey?: string) { | ||
if (major(React.version) === 18) { | ||
const message = '[cypress/react]: You are using `cypress/react`, which is designed for React <= 17. Consider changing to `cypress/react18`, which is designed for React 18.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer need this as we only support 18 and up
@@ -1,98 +0,0 @@ | |||
# Enzyme examples | |||
|
|||
This folder shows several examples from [Enzyme docs](https://enzymejs.github.io/enzyme/). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enzyme example tests are deleted since enzyme is no longer maintained
Additional details
Updates
cypress/react
to be thecypress/react18
test harness and removes support for react 16 and 17 for component testing. Since thecypress/react18
test harness is merged upstream intocypress/react
, thecypress/react18
harness is no longer shipped with the binary and thecypress/react18
package will be deprecated when we release cypress 14 (a part of the release checklist)most of the system test updates to react 18 happened in #30614 to make this PR smaller. The only changes here should be to reference the merged upstream harness,
cypress/react
Steps to test
How has the user experience changed?
Test examples in the react test harness have been updated to use functional components and hooks (except 1 until react class components are completely removed)
You can also test migration via the binary 34043f9
When users try to start their tests using the
cypress/react18
test harness, the tests errors withcypress/react18
is not exported fromcypress
:Updating
cypress/react18
tocypress/react
resolves the issueUsers are initially warned on the launchpad that the version is not compatible
When starting Component testing with the new
cypress/react
harness, an error throughs thatreact-dom/client
cannot be founddownloading
@cypress/react@8
and changing the mount function fromcypress/react
to@cypress/react
allows the tests to runPR Tasks
cypress-documentation
? chore: update react documentation for Cypress 14 cypress-documentation#6003type definitions
?