From 8e6807551880766757a21f906df92161f5173875 Mon Sep 17 00:00:00 2001 From: rickhanlonii Date: Mon, 2 Apr 2018 22:04:42 -0400 Subject: [PATCH 1/2] Switch collectCoverageFrom back to a string --- CHANGELOG.md | 1 - docs/CLI.md | 4 ++-- integration-tests/__tests__/coverage_report.test.js | 3 ++- packages/jest-cli/src/cli/args.js | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6cf10eceaff..6871fc0ca351 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,6 @@ * `[jest-editor-support]` Add `no-color` option to runner ([#5909](https://github.com/facebook/jest/pull/5909)) - ### Fixes * `[jest-runner]` Assign `process.env.JEST_WORKER_ID="1"` when in runInBand mode 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.', From cca2a80318fb94e74f4a2bd366d29bcbcd584326 Mon Sep 17 00:00:00 2001 From: rickhanlonii Date: Mon, 2 Apr 2018 22:12:54 -0400 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6871fc0ca351..d599c7e680df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,13 +73,15 @@ ([#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)) ### Chore & Maintenance * `[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))