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

Consider removing cypress as a peer dependency? #216

Open
tvsbrent opened this issue Mar 9, 2022 · 0 comments
Open

Consider removing cypress as a peer dependency? #216

tvsbrent opened this issue Mar 9, 2022 · 0 comments

Comments

@tvsbrent
Copy link

tvsbrent commented Mar 9, 2022

  • cypress-testing-library version: 8.0.2
  • node version: 16.13.1
  • npm (or yarn) version: 8.5.0

What you did: npm install @testing-library/cypress

What happened: Due to the peerDependencies work in NPM 8, Cypress was installed in the project. However, for our organization's continuous integration pipelines, we use a Docker image that has Cypress installed globally, so this is unnecessary and can introduce CI job fails.

Reproduction repository: n/a

Problem description: As mentioned above, we have Cypress installed in the Docker image used by our CI pipeline. This is to speed up the CI agent runs, as they don't need to download the Cypress binary. This was not a problem with previous versions of NPM, as while it would complain about a missing peer dependency, it wouldn't install that dependency.

With NPM 8, the behavior changed, so unless the --legacy-peer-deps argument is used, Cypress is now installed when this library is installed. This has the effect of slowing down the test run. It also has the potential of introducing errors if the version chosen by NPM is not the same as the version installed globally.

Suggested solution: Could cypress be removed as a peer dependency? I realize that installing Cypress globally is not the recommended practice, but has worked for us. Could the fact the library is named @testing-library/cypress be sufficient to know Cypress is needed?

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

No branches or pull requests

1 participant