diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f66686e4a4e..169c2270b0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/e2e/__tests__/config.test.ts b/e2e/__tests__/config.test.ts index 002cd04fd65e..c4a1eee622fd 100644 --- a/e2e/__tests__/config.test.ts +++ b/e2e/__tests__/config.test.ts @@ -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); +}); diff --git a/packages/jest-cli/package.json b/packages/jest-cli/package.json index e013b62bdd02..3588bb96fba2 100644 --- a/packages/jest-cli/package.json +++ b/packages/jest-cli/package.json @@ -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", diff --git a/packages/jest-repl/package.json b/packages/jest-repl/package.json index 12d7dbf4ac40..f2530d0bd377 100644 --- a/packages/jest-repl/package.json +++ b/packages/jest-repl/package.json @@ -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", diff --git a/packages/jest-runtime/package.json b/packages/jest-runtime/package.json index a7af1a73d5d1..e05141f6e48d 100644 --- a/packages/jest-runtime/package.json +++ b/packages/jest-runtime/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index 98ed8db9afe2..a54f6c17abf2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" "*" @@ -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" @@ -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" @@ -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"