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

chore: support vite v4 for component testing #25365

Merged
merged 5 commits into from
Jan 6, 2023
Merged

Conversation

marktnoonan
Copy link
Contributor

User facing changelog

Vite 4+ will no longer show a warning when used for component testing projects.

Additional details

Steps to test

How has the user experience changed?

Previously there were warnings about the dependency in the launchpad, and setup was possible but only by ignoring what Cypress tells you about Vite versions it supports.

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?

@cypress
Copy link

cypress bot commented Jan 4, 2023



Test summary

26418 0 1179 0Flakiness 47


Run details

Project cypress
Status Passed
Commit 6349e42
Started Jan 6, 2023 7:56 PM
Ended Jan 6, 2023 8:14 PM
Duration 18:41 💡
OS Linux Debian -
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

create-from-component.cy.ts Flakiness
1 ... > runs generated spec
commands/net_stubbing.cy.ts Flakiness
1 network stubbing > intercepting request > can delay and throttle a StaticResponse
2 network stubbing > intercepting request > can reply with a JSON fixture
3 network stubbing > intercepting request > can delay and throttle a StaticResponse
4 ... > with `times` > only uses each handler N times
This comment includes only the first 5 flaky tests. See all 47 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@@ -76,7 +76,7 @@ export const WIZARD_DEPENDENCY_VITE = {
package: 'vite',
installer: 'vite',
description: 'Vite is dev server that serves your source files over native ES modules',
minVersion: '^=2.0.0 || ^=3.0.0',
minVersion: '^=2.0.0 || ^=3.0.0 || ^=4.0.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not specific to this PR, just curious to get some thoughts - as we add more major versions to the support baseline do we want to continue this pattern or would something like this be easier to manage?
>=2.0.0 <5.0.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's easier, unless we encounter the rare situation where a single major isn't supported, but newer and older versions are (like with Node).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, there isn't an "exclude" operator so we'd end up having to stitch ranges together. In any event, not an issue at the moment just brainstorming a bit.

@@ -1,850 +1,4 @@
exports['@cypress/vite-dev-server react executes all of the tests for vite3.0.2-react 1'] = `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This deletion doesn't feel right - I would expect a large addition here for 4.0.4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, looks like I committed the wrong updated snapshot, will come back to this after some IATR stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

@marktnoonan marktnoonan changed the title chore: allow vite v4 for component testing chore: support vite v4 for component testing Jan 6, 2023
@marktnoonan marktnoonan merged commit ca53ee0 into develop Jan 6, 2023
@marktnoonan marktnoonan deleted the marktnoonan/vite-4 branch January 6, 2023 20:28
tgriesser added a commit that referenced this pull request Jan 18, 2023
* develop: (45 commits)
  fix: re-enable CYPRESS_INTERNAL_VITE_DEV development (#25364)
  fix: add skip domain injection description (#25463)
  fix: revert CSP header and script-src addition (#25445)
  chore: Update v8 snapshot cache (#25401)
  feat: Do not strip CSP headers from HTTPResponse (#24760)
  fix: keep spaces in formatted output in test runner (#24687)
  fix: Restrict dependency versions to known supported ranges (#25380)
  chore: Update v8 snapshot cache (#25370)
  feat: experimental skip domain injection (#25307)
  chore: support vite v4 for component testing (#25365)
  feat: Use JSX/TSX in generated spec filenames (#25318)
  docs(angular): Properties that are spied upon have to be defined within `componentProperties` instead of on root level. (#25359)
  chore: remove lint-changed from scripts/docs (#25308)
  chore: bump to 12.3.0 [skip ci] (#25355)
  fix: make NODE_ENV "production" for prod builds of launchpad (#25320)
  fix: .contains() should only return one element at all times (#25250)
  feat: add currentRetry to Cypress API (#25297)
  chore: release @cypress/webpack-dev-server-v3.2.2
  chore: release create-cypress-tests-v2.0.1
  fix: change wording for spec creation (#25271)
  ...
@Ancient-Dragon
Copy link

@marktnoonan hey thanks for the work here, any chance of a release soon to include this fix?

@marktnoonan
Copy link
Contributor Author

@Ancient-Dragon this should be in a release later this month. In the meantime it's safe to just ignore the warning Cypress gives about Vite 4 support and use it. It warns because we don't explicitly support breaking changes to a bundler without testing ourselves. This PR adds some testing that verifies Vite 4 works with Cypress, but didn't require any changes to Cypress code. So you should be good to go.

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

Successfully merging this pull request may close these issues.

CT: vite v4 support
4 participants