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

refactor: use aliases instead of meta #19566

Merged
merged 11 commits into from
Jan 19, 2022

Conversation

elevatebart
Copy link
Contributor

@elevatebart elevatebart commented Jan 5, 2022

User facing changelog

Probably more stable testing with vite.

Additional details

With the ambition to pregenerate vitejs tests this refactoring was necessary.
It brings the build philosophy closer to other rollup/vite plugins and makes it buildable.

Changes:

  • instead of using import.meta.env.__cypress_supportPathand __cypress_originAutUrl use strongly typed import aliases cypress:config
  • instead of loading the specs purely dynamically, resolve all the specs in a plugin generated specLoaders file and load it with the alias cypress:spec-loaders. If the current spec is not pre-loaded, use a purely dynamic, but that should be the exception
  • resolve the supportfile statically on the server and use the cypress:support-path alias to access it
  • move the startServer.ts/start() code to index.ts to simplify architecture
  • rename the file to resolveServerConfig.ts since it now only contains the config resolution

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 5, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Jan 5, 2022



Test summary

4297 0 51 0Flakiness 1


Run details

Project cypress
Status Passed
Commit 756d8bf
Started Jan 19, 2022 4:52 AM
Ended Jan 19, 2022 5:03 AM
Duration 10:51 💡
OS Linux Debian - 10.10
Browser Electron 94

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/commands/net_stubbing_spec.ts Flakiness
1 network stubbing > waiting and aliasing > can timeout waiting on a single request using "alias.request"

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

@elevatebart elevatebart force-pushed the elevatebart/refactor/vite-plugin branch from 8f0fe6c to 2126fc8 Compare January 5, 2022 16:54
Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Left one comment. Also it should be easy to add a system-test for this behavior (perhaps one for supportFile: '/somewhere' and supportFile: false? You could look at system-tests/tests/run-ct_spec.js. I don't think we have any system-tests using Vite so this would be quite nice to have. What do you think?

npm/vite-dev-server/src/makeCypressPlugin.ts Outdated Show resolved Hide resolved
@elevatebart
Copy link
Contributor Author

elevatebart commented Jan 10, 2022

Adding a system test is a very good idea, I will add it before I merge this request.

[EDIT] ... system tests are not implemented in 9.X will have to postpone.

@lmiller1990
Copy link
Contributor

@elevatebart
Copy link
Contributor Author

I cannot understand how I missed that. Probably a case of the Mondays. Will make sure it's tested tomorrow and ping you then.

@elevatebart
Copy link
Contributor Author

elevatebart commented Jan 11, 2022

@lmiller1990 system test added system-tests/test/vite_example_spec.ts

@lmiller1990 lmiller1990 merged commit 5cdf2ee into master Jan 19, 2022
@lmiller1990 lmiller1990 deleted the elevatebart/refactor/vite-plugin branch January 19, 2022 05:00
tgriesser added a commit that referenced this pull request Feb 14, 2022
* develop:
  feat: gray out the path to system node in cypress run header (#20121)
  feat: redesign server errors (#20072)
  test: fix awesome-typescript-loader test and remove test-binary job (#20131)
  fix: Fix issues with stack traces and command log in Chrome 99 (#20049)
  fix: `cy.type(' ')` fires click event on button-like elements. (#20067)
  fix: `change`, `input` events are not fired when the same option is selected again. (#19623)
  build: publish vue3 on latest (#20099)
  chore: release @cypress/webpack-preprocessor-v5.11.1
  chore: release @cypress/webpack-dev-server-v1.8.1
  fix: detect newly added specs in dev-server compilation (#17950)
  chore: Remove pkg/driver //@ts-nocheck part 3 (#19837)
  chore: set up semantic-pull-request GitHub Action (#20091)
  chore: release @cypress/react-v5.12.2
  fix: remove nullish coalescing in js files to support node 12 (#20094)
  docs: update @cypress/webpack-preprocessor links (#19902)
  refactor: use aliases instead of meta (#19566)
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.

2 participants