Skip to content

Commit

Permalink
fix: support collectCoverage in project config
Browse files Browse the repository at this point in the history
  • Loading branch information
munirapp committed Sep 22, 2024
1 parent bd1c6db commit 745c65a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions e2e/__tests__/__snapshots__/showConfig.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
"cache": false,
"cacheDirectory": "/tmp/jest",
"clearMocks": false,
"collectCoverage": false,
"collectCoverageFrom": [],
"coverageDirectory": "<<REPLACED_ROOT_DIR>>/coverage",
"coveragePathIgnorePatterns": [
Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/ValidConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export const initialProjectOptions: Config.InitialProjectOptions = {
cache: true,
cacheDirectory: '/tmp/user/jest',
clearMocks: false,
collectCoverage: true,
collectCoverageFrom: ['src', '!public'],
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [NODE_MODULES_REGEXP],
Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ const groupOptions = (
cache: options.cache,
cacheDirectory: options.cacheDirectory,
clearMocks: options.clearMocks,
collectCoverage: options.collectCoverage,
collectCoverageFrom: options.collectCoverageFrom,
coverageDirectory: options.coverageDirectory,
coveragePathIgnorePatterns: options.coveragePathIgnorePatterns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exports[`prints the config object 1`] = `
"cache": false,
"cacheDirectory": "/test_cache_dir/",
"clearMocks": false,
"collectCoverage": false,
"collectCoverageFrom": [
"src",
"!public"
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ export type ProjectConfig = {
cache: boolean;
cacheDirectory: string;
clearMocks: boolean;
collectCoverage: boolean;
collectCoverageFrom: Array<string>;
coverageDirectory: string;
coveragePathIgnorePatterns: Array<string>;
Expand Down
1 change: 1 addition & 0 deletions packages/test-utils/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
cache: false,
cacheDirectory: '/test_cache_dir/',
clearMocks: false,
collectCoverage: false,
collectCoverageFrom: ['src', '!public'],
coverageDirectory: 'coverage',
coveragePathIgnorePatterns: [],
Expand Down

0 comments on commit 745c65a

Please sign in to comment.