Comments (4)
@yagudaev I've released a new version of @knapsack-pro/cypress
4.0.0. It uses peerDependency so it means your cypress version defined in your project package.json
will be used by @knapsack-pro/cypress
.
I also added support for Cypress 5.x so @knapsack-pro/cypress
currently works with Cypress 3.x, 4.x, 5.x.
from knapsack-pro-cypress.
Hey @yagudaev
This change "cypress": ">= 4.9.0"
is not needed but I did it and released a new version of @knapsack-pro/cypress
where I applied your suggestion.
This "cypress": ">= 4.9.0"
will make @knapsack-pro/cypress
work also with Cypress 5.x if it will be ever released in the future.
Here is PR with my change: #33
After the fact. Once I released above change I realized that the "cypress": "^4.9.0"
was already good enough so your suggestion was not needed.
https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004
Caret range allows updating minor and patch version so any 4.x version of cypress should be possible to install.
What you did in package.json is expect. Programmer should be able to control what Cypress version he wants to use. You should explicitly specify Cypress version you want to use.
{
"devDependencies": {
"@knapsack-pro/cypress": "3.1.0",
"cypress": "^4.11.0",
},
}
Side thought. A while ago someone suggest to me to use peerDepenency
https://docs.npmjs.com/files/package.json#peerdependencies so I'm thinking about it as a solution to make it more explicit for programmers to manage test runner like Cypress or Jest version that is used in their project.
from knapsack-pro-cypress.
I consulted this bug with @rafaltrzop who initially helped develop the project.
It made me realized that I did not understand the full picture.
@yagudaev You are using https://www.npmjs.com/package/npm-force-resolutions package to force installing a specific version of Cypress. This explains why in your project you have resolutions
.
// package.json of your project
{
"devDependencies": {
"cypress": "^4.11.0",
} ,
"resolutions": {
"cypress": "^4.11.0"
}
}
If you wouldn't use resolutions
then the fact that I added "cypress": ">= 4.9.0"
in package.json
for @knapsack-pro/cypress
it would do nothing. When you add @knapsack-pro/cypress
to your project package.json
then knapsack will be installed with cypress version exactly specified inside of package-lock.json
of @knapsack-pro/cypress
. Because of that when you will run tests with knapsack then it will use old Cypress version.
But when you use Cypress in development environment without knapsack then you will use newer version of cypress.
This could lead to bugs because someone in the development environment may use new cypress features but on CI he will use @knapsack-pro/cypress
with older Cypress version.
To fix this problem we should use peerDepenency
specified in package.json
for @knapsack-pro/cypress
. Then when someone will install @knapsack-pro/cypress
he must also explicitly install Cypress in his project package.json
(we could add info about it in our readme to make installation smooth because not every developer may be familiar with peerDependency
). Thanks to that developer will control what version of Cypress is used and exactly the same Cypress version will be used in development when running tests without knapsack (only with cypress) and the same version of cypress will be used on CI when running tests with @knapsack-pro/cypress
.
FYI @shadre
from knapsack-pro-cypress.
Thank you @ArturT for the quick and detailed response.
from knapsack-pro-cypress.
Related Issues (11)
- Pass CLI arguments to cypress.run HOT 2
- False positive (zero exit code) returned when versions mismatch HOT 7
- Retries with Cypress 5.x and BuildKite HOT 7
- Missing build id environment variable for github actions HOT 2
- Rerunning pipelines may not work with --project flag. HOT 6
- Bitbucket Guideline - Issues to know exactly how I have to install this by using bitbucket HOT 1
- Can't force disable Cypress recording HOT 1
- [Security] Upgrade axios dependency in `@knapsack-pro/core` to 0.21.2 or later HOT 3
- Feature: Support exclusion pattern with KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN env var HOT 3
- Update for Cypress 12 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knapsack-pro-cypress.