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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update yargs to fix CLI flag overriding #9519

Merged
merged 6 commits into from Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Expand Up @@ -11,11 +11,12 @@
### Fixes

- `[expect]` Handle readonly properties correctly ([#9575](https://github.com/facebook/jest/pull/9575))
- `[jest-cli]` Set `coverageProvider` correctly when provided in config ([#9562](https://github.com/facebook/jest/pull/9562))
- `[jest-cli]` Allow specifying `.cjs` and `.mjs` config files by `--config` CLI option ([#9578](https://github.com/facebook/jest/pull/9578))
- `[jest-cli]` Update yargs to fix CLI flag overriding ([#9519](https://github.com/facebook/jest/pull/9519))
- `[jest-config]` Treat `setupFilesAfterEnv` like `setupFiles` when normalizing configs against presets ([#9495](https://github.com/facebook/jest/pull/9495))
- `[jest-config]` Support `.mjs` config files on Windows as well ([#9558](https://github.com/facebook/jest/pull/9558))
- `[jest-config]` Verify `rootDir` and all `roots` are directories ([#9569](https://github.com/facebook/jest/pull/9569))
- `[jest-cli]` Set `coverageProvider` correctly when provided in config ([#9562](https://github.com/facebook/jest/pull/9562))
- `[jest-cli]` Allow specifying `.cjs` and `.mjs` config files by `--config` CLI option ([#9578](https://github.com/facebook/jest/pull/9578))
- `[jest-config]` Ensure pattern of `replacePosixSep` is a string ([#9546](https://github.com/facebook/jest/pull/9546)
- `[jest-haste-map]` Fix crash on unix based systems without find ([#9579](https://github.com/facebook/jest/pull/9579))
- `[jest-jasmine2]` Fix `--testNamePattern` matching with `concurrent` tests ([#9090](https://github.com/facebook/jest/pull/9090))
Expand Down
13 changes: 13 additions & 0 deletions e2e/__tests__/config.test.ts
Expand Up @@ -68,3 +68,16 @@ test('works with jsdom testEnvironmentOptions config JSON', () => {
expect(result.exitCode).toBe(0);
expect(result.stderr).toContain('found url jestjs.io');
});

test('negated flags override previous flags', () => {
const {stdout} = runJest('verbose-reporter', [
'--show-config',
'--silent',
'--no-silent',
'--silent',
]);

const parsedConfig = JSON.parse(stdout);

expect(parsedConfig.globalConfig.silent).toEqual(true);
});
2 changes: 1 addition & 1 deletion packages/jest-cli/package.json
Expand Up @@ -17,7 +17,7 @@
"jest-validate": "^25.1.0",
"prompts": "^2.0.1",
"realpath-native": "^2.0.0",
"yargs": "^15.0.0"
"yargs": "^15.2.0"
},
"devDependencies": {
"@jest/test-utils": "^25.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-repl/package.json
Expand Up @@ -16,7 +16,7 @@
"jest-runtime": "^25.1.0",
"jest-validate": "^25.1.0",
"repl": "^0.1.3",
"yargs": "^15.0.0"
"yargs": "^15.2.0"
},
"devDependencies": {
"@jest/test-utils": "^25.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-runtime/package.json
Expand Up @@ -34,7 +34,7 @@
"realpath-native": "^2.0.0",
"slash": "^3.0.0",
"strip-bom": "^4.0.0",
"yargs": "^15.0.0"
"yargs": "^15.2.0"
},
"devDependencies": {
"@jest/test-utils": "^25.1.0",
Expand Down
24 changes: 12 additions & 12 deletions yarn.lock
Expand Up @@ -2496,9 +2496,9 @@
"@types/yargs-parser" "*"

"@types/yargs@^15.0.0", "@types/yargs@^15.0.3":
version "15.0.3"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.3.tgz#41453a0bc7ab393e995d1f5451455638edbd2baf"
integrity sha512-XCMQRK6kfpNBixHLyHUsGmXrpEmFFxzMrcnSXFMziHd8CoNJo8l16FkHyQq4x+xbM7E2XL83/O78OD8u+iZTdQ==
version "15.0.4"
resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.4.tgz#7e5d0f8ca25e9d5849f2ea443cf7c402decd8299"
integrity sha512-9T1auFmbPZoxHz0enUFlUuKRy3it01R+hlggyVUMtnCTQRunsQYifnSGb8hET4Xo8yiC0o0r1paW3ud5+rbURg==
dependencies:
"@types/yargs-parser" "*"

Expand Down Expand Up @@ -15051,10 +15051,10 @@ yargs-parser@^15.0.0:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^16.1.0:
version "16.1.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1"
integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==
yargs-parser@^17.1.0:
version "17.1.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-17.1.0.tgz#b95ff3201e98b89e86070f92bef636016a0b0766"
integrity sha512-67zLl4/kWtp9eyVuxX+fHZ2Ey4ySWh0awDJlk/EtT0vzspsXbzrFsh76WjYSP3L++zhSwHQRUE3MCBe754RuEg==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"
Expand Down Expand Up @@ -15126,10 +15126,10 @@ yargs@^14.2.2:
y18n "^4.0.0"
yargs-parser "^15.0.0"

yargs@^15.0.0:
version "15.1.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.1.0.tgz#e111381f5830e863a89550bd4b136bb6a5f37219"
integrity sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==
yargs@^15.2.0:
version "15.2.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.2.0.tgz#cb9fc7f7ec429f7e9329b623f5c707a62dae506a"
integrity sha512-E+o8C37U+M7N15rBJVxr0MoInp+O7XNhMqveSGWA5uhddqs8qtkZ+uvT9FI32QML0SKidXdDONr40Xe3tDO9FA==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
Expand All @@ -15141,7 +15141,7 @@ yargs@^15.0.0:
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^16.1.0"
yargs-parser "^17.1.0"

yargs@^2.3.0:
version "2.3.0"
Expand Down