Skip to content

Commit

Permalink
Merge pull request #1 from facebook/master
Browse files Browse the repository at this point in the history
fix: update yargs to fix CLI flag overriding (jestjs#9519)
  • Loading branch information
sthagen authored Mar 1, 2020
2 parents cc5d630 + e3aa106 commit 6e8b3b9
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 17 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -15056,10 +15056,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 @@ -15131,10 +15131,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 @@ -15146,7 +15146,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

0 comments on commit 6e8b3b9

Please sign in to comment.