From 196e5731c8985dbdb6ce7d224c9dd4348f356009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Mon, 7 Dec 2020 13:25:50 +0100 Subject: [PATCH] chore: remove mapCoverage remainings; remove deprecated CLI options test (#9968) --- CHANGELOG.md | 1 + e2e/__tests__/deprecatedCliOptions.test.ts | 25 ------------------- e2e/deprecated-cli-options/__tests__/dummy.js | 10 -------- e2e/deprecated-cli-options/package.json | 3 --- packages/jest-cli/src/cli/args.ts | 7 ------ packages/jest-config/src/Deprecated.ts | 6 ----- packages/jest-config/src/normalize.ts | 1 - packages/jest-types/src/Config.ts | 1 - packages/jest-types/src/Transform.ts | 1 - 9 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 e2e/__tests__/deprecatedCliOptions.test.ts delete mode 100644 e2e/deprecated-cli-options/__tests__/dummy.js delete mode 100644 e2e/deprecated-cli-options/package.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 692ac1876000..8906b1b307b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ - `[jest-runtime]` [**BREAKING**] Remove deprecated and unnused `getSourceMapInfo` from Runtime ([#9969](https://github.com/facebook/jest/pull/9969)) - `[jest-util]` No longer checking `enumerable` when adding `process.domain` ([#10862](https://github.com/facebook/jest/pull/10862)) - `[jest-validate]` [**BREAKING**] Remove `recursiveBlacklist ` option in favor of previously introduced `recursiveDenylist` ([#10650](https://github.com/facebook/jest/pull/10650)) +- `[*]` [**BREAKING**] Remove deprecated `mapCoverage` ([#9968](https://github.com/facebook/jest/pull/9968)) ### Performance diff --git a/e2e/__tests__/deprecatedCliOptions.test.ts b/e2e/__tests__/deprecatedCliOptions.test.ts deleted file mode 100644 index 4334b065dc43..000000000000 --- a/e2e/__tests__/deprecatedCliOptions.test.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -import * as path from 'path'; -import runJest from '../runJest'; - -const dir = path.resolve(__dirname, '../deprecated-cli-options'); - -it('Prints deprecation warnings for CLI flags', () => { - const {stderr, exitCode} = runJest(dir, ['--mapCoverage']); - expect(exitCode).toBe(0); - expect(stderr).toMatch(/Test Suites: 1 passed, 1 total/); - expect(stderr).toMatch(`● Deprecation Warning: - - Option "mapCoverage" has been removed, as it's no longer necessary. - - Please update your configuration. - - CLI Options Documentation: - https://jestjs.io/docs/en/cli.html`); -}); diff --git a/e2e/deprecated-cli-options/__tests__/dummy.js b/e2e/deprecated-cli-options/__tests__/dummy.js deleted file mode 100644 index 1925b3756db7..000000000000 --- a/e2e/deprecated-cli-options/__tests__/dummy.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -test('Dummy', () => { - expect(2).toBe(2); -}); diff --git a/e2e/deprecated-cli-options/package.json b/e2e/deprecated-cli-options/package.json deleted file mode 100644 index 586d4ca6b75c..000000000000 --- a/e2e/deprecated-cli-options/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "jest": {} -} diff --git a/packages/jest-cli/src/cli/args.ts b/packages/jest-cli/src/cli/args.ts index fe74a2f6c4c1..60384b41fe1c 100644 --- a/packages/jest-cli/src/cli/args.ts +++ b/packages/jest-cli/src/cli/args.ts @@ -361,13 +361,6 @@ export const options = { 'node.', type: 'boolean', }, - mapCoverage: { - default: undefined, - description: - 'Maps code coverage reports against original source code ' + - 'when transformers supply source maps.\n\nDEPRECATED', - type: 'boolean', - }, maxConcurrency: { default: 5, description: diff --git a/packages/jest-config/src/Deprecated.ts b/packages/jest-config/src/Deprecated.ts index 0e0bc23ee732..f43ec9d4d7a2 100644 --- a/packages/jest-config/src/Deprecated.ts +++ b/packages/jest-config/src/Deprecated.ts @@ -20,12 +20,6 @@ const deprecatedOptions: DeprecatedOptions = { } `, - mapCoverage: () => ` Option ${chalk.bold( - '"mapCoverage"', - )} has been removed, as it's no longer necessary. - - Please update your configuration.`, - preprocessorIgnorePatterns: (options: { preprocessorIgnorePatterns?: Array; }) => ` Option ${chalk.bold( diff --git a/packages/jest-config/src/normalize.ts b/packages/jest-config/src/normalize.ts index e31cefaa3bf4..d2e2f060fbef 100644 --- a/packages/jest-config/src/normalize.ts +++ b/packages/jest-config/src/normalize.ts @@ -958,7 +958,6 @@ export default function normalize( case 'listTests': case 'logHeapUsage': case 'maxConcurrency': - case 'mapCoverage': case 'name': case 'noStackTrace': case 'notify': diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index 40da453ae5e8..8b8243994a0e 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -155,7 +155,6 @@ export type InitialOptions = Partial<{ logHeapUsage: boolean; lastCommit: boolean; listTests: boolean; - mapCoverage: boolean; maxConcurrency: number; maxWorkers: number | string; moduleDirectories: Array; diff --git a/packages/jest-types/src/Transform.ts b/packages/jest-types/src/Transform.ts index 6371a226c201..43e9ff986eb1 100644 --- a/packages/jest-types/src/Transform.ts +++ b/packages/jest-types/src/Transform.ts @@ -9,6 +9,5 @@ export type TransformResult = { code: string; originalCode: string; - mapCoverage?: boolean; // TODO - Remove in Jest 27 sourceMapPath: string | null; };