Do you want to request a feature or report a bug?
bug
What is the current behavior?
Because of the way jest packages are set up, if you:
npm install jest@18.0.0 then it actually installs jest-cli@18.1.0 (or whatever the greatest minor version release is)
If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can yarn install and yarn test.
- cd into an npm project directory
npm install jest@18.0.0 --save
- observe that
package.json is set to depend on `"jest":"18.0.0" (exact version)
grep version node_modules/jest/package.json
- observe output is `"version": "18.0.0"
node node_modules/jest/bin/jest.js -v
- Output is
v18.1.0 (WRONG VERSION!)
grep version node_modules/jest-cli/package.json
- observe output is `"version": "18.1.0" (NOT18.0.0!)
What is the expected behavior?
The exact version of jest should be installed.
The problem is that packages/jest/package.json contains carrot versions of jest-cli
"dependencies": {
"jest-cli": "^18.0.0"
},
so when jest@18.0.0 is installed, it also gets the latest ^18.* release of jest-cli installed.
all the package.json files in /packages should be exact-version dependencies when they are tagged.
The same holds true with v19 releases... they contain the dependency "jest-cli@^19.0.2" so if jest 19.7.0 were to be released and someone tries to npm install jest@~19.0.2 then too bad, you get 19.7.0 anyway even though you only wanted 19.0.* releases.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
Because of the way jest packages are set up, if you:
npm install jest@18.0.0then it actually installsjest-cli@18.1.0(or whatever the greatest minor version release is)If the current behavior is a bug, please provide the steps to reproduce and either a repl.it demo through https://repl.it/languages/jest or a minimal repository on GitHub that we can
yarn installandyarn test.npm install jest@18.0.0 --savepackage.jsonis set to depend on `"jest":"18.0.0" (exact version)grep version node_modules/jest/package.jsonnode node_modules/jest/bin/jest.js -vv18.1.0(WRONG VERSION!)grep version node_modules/jest-cli/package.jsonWhat is the expected behavior?
The exact version of jest should be installed.
The problem is that
packages/jest/package.jsoncontains carrot versions ofjest-cliso when
jest@18.0.0is installed, it also gets the latest^18.*release ofjest-cliinstalled.all the package.json files in /packages should be exact-version dependencies when they are tagged.
The same holds true with v19 releases... they contain the dependency "jest-cli@^19.0.2" so if jest 19.7.0 were to be released and someone tries to
npm install jest@~19.0.2then too bad, you get 19.7.0 anyway even though you only wanted 19.0.* releases.Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.