diff --git a/CHANGELOG.md b/CHANGELOG.md index 60541aec1eb4..82fa07a9290d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Fixes +- `[jest-config]` Add missing options to the `defaults` object ([#6428](https://github.com/facebook/jest/pull/6428)) - `[expect]` Using symbolic property names in arrays no longer causes the `toEqual` matcher to fail ([#6391](https://github.com/facebook/jest/pull/6391)) - `[expect]` `toEqual` no longer tries to compare non-enumerable symbolic properties, to be consistent with non-symbolic properties. ([#6398](https://github.com/facebook/jest/pull/6398)) diff --git a/e2e/__tests__/__snapshots__/module_name_mapper.test.js.snap b/e2e/__tests__/__snapshots__/module_name_mapper.test.js.snap index f76ae0cc6f8b..711efe6e6b06 100644 --- a/e2e/__tests__/__snapshots__/module_name_mapper.test.js.snap +++ b/e2e/__tests__/__snapshots__/module_name_mapper.test.js.snap @@ -20,7 +20,7 @@ exports[`moduleNameMapper wrong configuration 1`] = ` \\"moduleNameMapper\\": { \\"/\\\\.(css|less)$/\\": \\"no-such-module\\" }, - \\"resolver\\": undefined + \\"resolver\\": null " `; diff --git a/e2e/__tests__/__snapshots__/show_config.test.js.snap b/e2e/__tests__/__snapshots__/show_config.test.js.snap index 452102922c3b..04b1d7f17d90 100644 --- a/e2e/__tests__/__snapshots__/show_config.test.js.snap +++ b/e2e/__tests__/__snapshots__/show_config.test.js.snap @@ -35,6 +35,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"name\\": \\"[md5 hash]\\", \\"resetMocks\\": false, \\"resetModules\\": false, + \\"resolver\\": null, \\"restoreMocks\\": false, \\"rootDir\\": \\"<>\\", \\"roots\\": [ @@ -42,6 +43,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` ], \\"runner\\": \\"jest-runner\\", \\"setupFiles\\": [], + \\"setupTestFrameworkScriptFile\\": null, \\"skipFilter\\": false, \\"snapshotSerializers\\": [], \\"testEnvironment\\": \\"jest-environment-jsdom\\", @@ -73,6 +75,8 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"globalConfig\\": { \\"bail\\": false, \\"changedFilesWithAncestor\\": false, + \\"collectCoverage\\": false, + \\"collectCoverageFrom\\": null, \\"coverageDirectory\\": \\"<>/coverage\\", \\"coverageReporters\\": [ \\"json\\", @@ -80,6 +84,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"lcov\\", \\"clover\\" ], + \\"coverageThreshold\\": null, \\"detectLeaks\\": false, \\"detectOpenHandles\\": false, \\"errorOnDeprecated\\": false, @@ -94,6 +99,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"notify\\": false, \\"notifyMode\\": \\"always\\", \\"passWithNoTests\\": false, + \\"projects\\": null, \\"rootDir\\": \\"<>\\", \\"runTestsByPath\\": false, \\"skipFilter\\": false, diff --git a/packages/jest-config/src/defaults.js b/packages/jest-config/src/defaults.js index 6fdf7fb55c70..8710f5de56bd 100644 --- a/packages/jest-config/src/defaults.js +++ b/packages/jest-config/src/defaults.js @@ -35,8 +35,12 @@ export default ({ cacheDirectory, changedFilesWithAncestor: false, clearMocks: false, + collectCoverage: false, + collectCoverageFrom: null, + coverageDirectory: null, coveragePathIgnorePatterns: [NODE_MODULES_REGEXP], coverageReporters: ['json', 'text', 'lcov', 'clover'], + coverageThreshold: null, detectLeaks: false, detectOpenHandles: false, errorOnDeprecated: false, @@ -57,11 +61,17 @@ export default ({ notify: false, notifyMode: 'always', preset: null, + projects: null, resetMocks: false, resetModules: false, + resolver: null, restoreMocks: false, + rootDir: null, + roots: [''], runTestsByPath: false, runner: 'jest-runner', + setupFiles: [], + setupTestFrameworkScriptFile: null, skipFilter: false, snapshotSerializers: [], testEnvironment: 'jest-environment-jsdom', @@ -72,8 +82,10 @@ export default ({ testPathIgnorePatterns: [NODE_MODULES_REGEXP], testRegex: '', testResultsProcessor: null, + testRunner: 'jasmine2', testURL: 'about:blank', timers: 'real', + transform: null, transformIgnorePatterns: [NODE_MODULES_REGEXP], useStderr: false, verbose: null, diff --git a/types/Config.js b/types/Config.js index 89aa7afbce57..9f2d0f317b0a 100644 --- a/types/Config.js +++ b/types/Config.js @@ -29,8 +29,12 @@ export type DefaultOptions = {| cacheDirectory: Path, changedFilesWithAncestor: boolean, clearMocks: boolean, + collectCoverage: boolean, + collectCoverageFrom: ?Array, + coverageDirectory: ?string, coveragePathIgnorePatterns: Array, coverageReporters: Array, + coverageThreshold: ?{global: {[key: string]: number}}, errorOnDeprecated: boolean, expand: boolean, filter: ?Path, @@ -49,11 +53,17 @@ export type DefaultOptions = {| notify: boolean, notifyMode: string, preset: ?string, + projects: ?Array, resetMocks: boolean, resetModules: boolean, + resolver: ?Path, restoreMocks: boolean, + rootDir: ?Path, + roots: ?Array, runner: string, runTestsByPath: boolean, + setupFiles: Array, + setupTestFrameworkScriptFile: ?Path, skipFilter: boolean, snapshotSerializers: Array, testEnvironment: string, @@ -64,8 +74,10 @@ export type DefaultOptions = {| testPathIgnorePatterns: Array, testRegex: string, testResultsProcessor: ?string, + testRunner: ?string, testURL: string, timers: 'real' | 'fake', + transform: ?{[key: string]: string}, transformIgnorePatterns: Array, watchPathIgnorePatterns: Array, useStderr: boolean,