Skip to content

Commit 8c3db5c

Browse files
authored
fix: add coverageReporters to ValidConfig.ts (#14830)
1 parent b6f27ab commit 8c3db5c

File tree

8 files changed

+23
-8
lines changed

8 files changed

+23
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
- `[jest-cli]` [**BREAKING**] Validate CLI flags that require arguments receives them ([#14783](https://github.com/jestjs/jest/pull/14783))
3535
- `[jest-config]` Make sure to respect `runInBand` option ([#14578](https://github.com/jestjs/jest/pull/14578))
3636
- `[jest-config]` Support `testTimeout` in project config ([#14697](https://github.com/jestjs/jest/pull/14697))
37+
- `[jest-config]` Support `coverageReporters` in project config ([#14697](https://github.com/jestjs/jest/pull/14830))
3738
- `[jest-config]` Allow `reporters` in project config ([#14768](https://github.com/jestjs/jest/pull/14768))
3839
- `[@jest/expect-utils]` Fix comparison of `DataView` ([#14408](https://github.com/jestjs/jest/pull/14408))
3940
- `[@jest/expect-utils]` [**BREAKING**] exclude non-enumerable in object matching ([#14670](https://github.com/jestjs/jest/pull/14670))

e2e/__tests__/__snapshots__/showConfig.test.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ exports[`--showConfig outputs config info and exits 1`] = `
1313
"coveragePathIgnorePatterns": [
1414
"/node_modules/"
1515
],
16+
"coverageReporters": [
17+
"json",
18+
"text",
19+
"lcov",
20+
"clover"
21+
],
1622
"cwd": "<<REPLACED_ROOT_DIR>>",
1723
"detectLeaks": false,
1824
"detectOpenHandles": false,

packages/jest-config/src/ValidConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export const initialProjectOptions: Config.InitialProjectOptions = {
208208
collectCoverageFrom: ['src', '!public'],
209209
coverageDirectory: 'coverage',
210210
coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
211+
coverageReporters: ['json', 'text', 'lcov', 'clover'],
211212
dependencyExtractor: '<rootDir>/dependencyExtractor.js',
212213
detectLeaks: false,
213214
detectOpenHandles: false,

packages/jest-config/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ const groupOptions = (
155155
collectCoverageFrom: options.collectCoverageFrom,
156156
coverageDirectory: options.coverageDirectory,
157157
coveragePathIgnorePatterns: options.coveragePathIgnorePatterns,
158+
coverageReporters: options.coverageReporters,
158159
cwd: options.cwd,
159160
dependencyExtractor: options.dependencyExtractor,
160161
detectLeaks: options.detectLeaks,

packages/jest-core/src/lib/__tests__/__snapshots__/logDebugMessages.test.ts.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exports[`prints the config object 1`] = `
1313
],
1414
"coverageDirectory": "coverage",
1515
"coveragePathIgnorePatterns": [],
16+
"coverageReporters": [],
1617
"cwd": "/test_root_dir/",
1718
"detectLeaks": false,
1819
"detectOpenHandles": false,

packages/jest-transform/src/__tests__/__snapshots__/ScriptTransformer.test.ts.snap

Lines changed: 11 additions & 8 deletions
Large diffs are not rendered by default.

packages/jest-types/src/Config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ export type ProjectConfig = {
333333
collectCoverageFrom: Array<string>;
334334
coverageDirectory: string;
335335
coveragePathIgnorePatterns: Array<string>;
336+
coverageReporters: CoverageReporters;
336337
cwd: string;
337338
dependencyExtractor?: string;
338339
detectLeaks: boolean;

packages/test-utils/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
7777
collectCoverageFrom: ['src', '!public'],
7878
coverageDirectory: 'coverage',
7979
coveragePathIgnorePatterns: [],
80+
coverageReporters: [],
8081
cwd: '/test_root_dir/',
8182
detectLeaks: false,
8283
detectOpenHandles: false,

0 commit comments

Comments
 (0)