Closed AtofStryker closed 10 hours ago
Passed #58560
•
41c9e19f09: feat: support next 15 [run ci]
Project |
cypress
|
Branch Review |
feat/support_next_15
|
Run status |
Passed #58560
|
Run duration | 26m 21s |
Commit |
41c9e19f09: feat: support next 15 [run ci]
|
Committer | AtofStryker |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
3
|
Pending |
1326
|
Skipped |
0
|
Passing |
29324
|
View all changes introduced in this branch ↗︎ |
UI Coverage
46.07%
|
|
---|---|
Untested elements |
187
|
Tested elements |
164
|
Accessibility
92.56%
|
|
---|---|
Failed rules |
3 critical
8 serious
2 moderate
2 minor
|
Failed elements |
892
|
Additional details
Adds Next.js 15 support, which depends on React 19 RC support in #30651. Main changes here are to scaffolding.
System Testing is somewhat limited
Unfortunately, testing Next.js 15 inside the monorepo is somewhat difficult since the installed version in the system-tests projects is React 19, but the monorepo root is react 18. To get around this, we usually use a webpack alias to resolve the react version. However, this doesn't work for
cypress/react
(ascli/react/dist
) since we reference it viaimport { mount } from "cypress/react"
, which is an esm style import through webpack which doesn't apply the aliases since the aliases point to CJS references. To get around this, we use arequire()
statement on the import so everything points to react 19 and we can test Next.js 15. This is only a problem due to our monorepo setup. In the wild, Next.js 15 works fine with ESM imports and can be tested via installing the built binaries against a create-next-app (as seen in https://github.com/cypress-io/cypress-component-testing-apps/pull/37).Using Next.js 15 with the built binary from this branch
Testing the build binaries works as expected against Next.js 15 create-next-app. This works OOTB since the
ReactDOM.render()
changes merged upstream intocypress/react
in #30590, so no custom test harness is needed 🎉Steps to test
Highly recommend creating a Next.js 15 project with create-next-app and installing the build binaries and setting up component testing.
How has the user experience changed?
Users can now use Cypress Component Testing With Next.js 15 in Cypress 14
PR Tasks
cypress-documentation
? https://github.com/cypress-io/cypress-documentation/pull/6008type definitions
?