diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d9a4ff6785..6edf542ec928 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,8 @@ ([#5720](https://github.com/facebook/jest/pull/5720)) * `[pretty-format]` Handle React fragments better ([#5816](https://github.com/facebook/jest/pull/5816)) +* `[jest-cli]` Switch collectCoverageFrom back to a string + ([#5914](https://github.com/facebook/jest/pull/5914)) * `[jest-regex-util]` Fix handling regex symbols in tests path on Windows ([#5941](https://github.com/facebook/jest/pull/5941)) @@ -83,7 +85,7 @@ * `[jest-jasmine2]` Simplify `Env.execute` and TreeProcessor to setup and clean resources for the top suite the same way as for all of the children suites ([#5885](https://github.com/facebook/jest/pull/5885)) -* `*` Run Prettier on compiled output +* `[*]` Run Prettier on compiled output ([#5858](https://github.com/facebook/jest/pull/3497)) * `[jest-cli]` Add fileChange hook for plugins ([#5708](https://github.com/facebook/jest/pull/5708)) diff --git a/docs/CLI.md b/docs/CLI.md index 5311e2441109..071ecba4d5e7 100644 --- a/docs/CLI.md +++ b/docs/CLI.md @@ -149,8 +149,8 @@ directory. The default cache directory can be found by calling ### `--collectCoverageFrom=` -An array of glob patterns relative to matching the files that coverage -info needs to be collected from. +A glob pattern relative to matching the files that coverage info needs +to be collected from. ### `--colors` diff --git a/integration-tests/__tests__/coverage_report.test.js b/integration-tests/__tests__/coverage_report.test.js index 136ead1c3b21..4a080e71f8d6 100644 --- a/integration-tests/__tests__/coverage_report.test.js +++ b/integration-tests/__tests__/coverage_report.test.js @@ -49,8 +49,9 @@ test('collects coverage only from multiple specified files', () => { const {stdout} = runJest(DIR, [ '--no-cache', '--coverage', - '--collectCoverageFrom', // overwrites the one in package.json + '--collectCoverageFrom', 'setup.js', + '--collectCoverageFrom', 'OtherFile.js', ]); diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index 41f3ce44e0c4..2559eb919bd2 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -153,9 +153,9 @@ export const options = { }, collectCoverageFrom: { description: - 'An array of glob patterns relative to matching the files ' + - 'that coverage info needs to be collected from.', - type: 'array', + 'A glob pattern relative to matching the files that coverage ' + + 'info needs to be collected from.', + type: 'string', }, collectCoverageOnlyFrom: { description: 'Explicit list of paths coverage will be restricted to.',