Skip to content

Commit e3aa106

Browse files
authored
fix: update yargs to fix CLI flag overriding (#9519)
1 parent cc5d630 commit e3aa106

6 files changed

Lines changed: 31 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
### Fixes
1212

1313
- `[expect]` Handle readonly properties correctly ([#9575](https://github.com/facebook/jest/pull/9575))
14+
- `[jest-cli]` Set `coverageProvider` correctly when provided in config ([#9562](https://github.com/facebook/jest/pull/9562))
15+
- `[jest-cli]` Allow specifying `.cjs` and `.mjs` config files by `--config` CLI option ([#9578](https://github.com/facebook/jest/pull/9578))
16+
- `[jest-cli]` Update yargs to fix CLI flag overriding ([#9519](https://github.com/facebook/jest/pull/9519))
1417
- `[jest-config]` Treat `setupFilesAfterEnv` like `setupFiles` when normalizing configs against presets ([#9495](https://github.com/facebook/jest/pull/9495))
1518
- `[jest-config]` Support `.mjs` config files on Windows as well ([#9558](https://github.com/facebook/jest/pull/9558))
1619
- `[jest-config]` Verify `rootDir` and all `roots` are directories ([#9569](https://github.com/facebook/jest/pull/9569))
17-
- `[jest-cli]` Set `coverageProvider` correctly when provided in config ([#9562](https://github.com/facebook/jest/pull/9562))
18-
- `[jest-cli]` Allow specifying `.cjs` and `.mjs` config files by `--config` CLI option ([#9578](https://github.com/facebook/jest/pull/9578))
1920
- `[jest-config]` Ensure pattern of `replacePosixSep` is a string ([#9546](https://github.com/facebook/jest/pull/9546)
2021
- `[jest-haste-map]` Fix crash on unix based systems without find ([#9579](https://github.com/facebook/jest/pull/9579))
2122
- `[jest-jasmine2]` Fix `--testNamePattern` matching with `concurrent` tests ([#9090](https://github.com/facebook/jest/pull/9090))

e2e/__tests__/config.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,16 @@ test('works with jsdom testEnvironmentOptions config JSON', () => {
6868
expect(result.exitCode).toBe(0);
6969
expect(result.stderr).toContain('found url jestjs.io');
7070
});
71+
72+
test('negated flags override previous flags', () => {
73+
const {stdout} = runJest('verbose-reporter', [
74+
'--show-config',
75+
'--silent',
76+
'--no-silent',
77+
'--silent',
78+
]);
79+
80+
const parsedConfig = JSON.parse(stdout);
81+
82+
expect(parsedConfig.globalConfig.silent).toEqual(true);
83+
});

packages/jest-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"jest-validate": "^25.1.0",
1818
"prompts": "^2.0.1",
1919
"realpath-native": "^2.0.0",
20-
"yargs": "^15.0.0"
20+
"yargs": "^15.2.0"
2121
},
2222
"devDependencies": {
2323
"@jest/test-utils": "^25.1.0",

packages/jest-repl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"jest-runtime": "^25.1.0",
1717
"jest-validate": "^25.1.0",
1818
"repl": "^0.1.3",
19-
"yargs": "^15.0.0"
19+
"yargs": "^15.2.0"
2020
},
2121
"devDependencies": {
2222
"@jest/test-utils": "^25.1.0",

packages/jest-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"realpath-native": "^2.0.0",
3535
"slash": "^3.0.0",
3636
"strip-bom": "^4.0.0",
37-
"yargs": "^15.0.0"
37+
"yargs": "^15.2.0"
3838
},
3939
"devDependencies": {
4040
"@jest/test-utils": "^25.1.0",

yarn.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,9 +2496,9 @@
24962496
"@types/yargs-parser" "*"
24972497

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

@@ -15056,10 +15056,10 @@ yargs-parser@^15.0.0:
1505615056
camelcase "^5.0.0"
1505715057
decamelize "^1.2.0"
1505815058

15059-
yargs-parser@^16.1.0:
15060-
version "16.1.0"
15061-
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1"
15062-
integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg==
15059+
yargs-parser@^17.1.0:
15060+
version "17.1.0"
15061+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-17.1.0.tgz#b95ff3201e98b89e86070f92bef636016a0b0766"
15062+
integrity sha512-67zLl4/kWtp9eyVuxX+fHZ2Ey4ySWh0awDJlk/EtT0vzspsXbzrFsh76WjYSP3L++zhSwHQRUE3MCBe754RuEg==
1506315063
dependencies:
1506415064
camelcase "^5.0.0"
1506515065
decamelize "^1.2.0"
@@ -15131,10 +15131,10 @@ yargs@^14.2.2:
1513115131
y18n "^4.0.0"
1513215132
yargs-parser "^15.0.0"
1513315133

15134-
yargs@^15.0.0:
15135-
version "15.1.0"
15136-
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.1.0.tgz#e111381f5830e863a89550bd4b136bb6a5f37219"
15137-
integrity sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==
15134+
yargs@^15.2.0:
15135+
version "15.2.0"
15136+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.2.0.tgz#cb9fc7f7ec429f7e9329b623f5c707a62dae506a"
15137+
integrity sha512-E+o8C37U+M7N15rBJVxr0MoInp+O7XNhMqveSGWA5uhddqs8qtkZ+uvT9FI32QML0SKidXdDONr40Xe3tDO9FA==
1513815138
dependencies:
1513915139
cliui "^6.0.0"
1514015140
decamelize "^1.2.0"
@@ -15146,7 +15146,7 @@ yargs@^15.0.0:
1514615146
string-width "^4.2.0"
1514715147
which-module "^2.0.0"
1514815148
y18n "^4.0.0"
15149-
yargs-parser "^16.1.0"
15149+
yargs-parser "^17.1.0"
1515015150

1515115151
yargs@^2.3.0:
1515215152
version "2.3.0"

0 commit comments

Comments
 (0)