diff --git a/CHANGELOG.md b/CHANGELOG.md index c3ffac342069..327f77a48ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - `[pretty-format]` Option to not escape strings in diff messages ([#5661](https://github.com/facebook/jest/pull/5661)) - `[jest-haste-map]` Add `getFileIterator` to `HasteFS` for faster file iteration ([#7010](https://github.com/facebook/jest/pull/7010)). - `[jest-worker]` [**BREAKING**] Add functionality to call a `setup` method in the worker before the first call and a `teardown` method when ending the farm ([#7014](https://github.com/facebook/jest/pull/7014)). +- `[jest-config]` [**BREAKING**] Set default `notifyMode` to `faluire-change` ([#7024](https://github.com/facebook/jest/pull/7024)) ### Fixes diff --git a/TestUtils.js b/TestUtils.js index 41215da10eb8..09956a281e41 100644 --- a/TestUtils.js +++ b/TestUtils.js @@ -40,7 +40,7 @@ const DEFAULT_GLOBAL_CONFIG: GlobalConfig = { noStackTrace: false, nonFlagArgs: [], notify: false, - notifyMode: 'always', + notifyMode: 'failure-change', onlyChanged: false, onlyFailures: false, outputFile: null, diff --git a/docs/Configuration.md b/docs/Configuration.md index 278921c06723..735ea9006b79 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -393,7 +393,7 @@ Activates notifications for test results. ### `notifyMode` [string] -Default: `always` +Default: `failure-change` Specifies notification mode. Requires `notify: true`. diff --git a/e2e/__tests__/__snapshots__/show_config.test.js.snap b/e2e/__tests__/__snapshots__/show_config.test.js.snap index e12bb522fdff..802d244a8076 100644 --- a/e2e/__tests__/__snapshots__/show_config.test.js.snap +++ b/e2e/__tests__/__snapshots__/show_config.test.js.snap @@ -98,7 +98,7 @@ exports[`--showConfig outputs config info and exits 1`] = ` \\"noStackTrace\\": false, \\"nonFlagArgs\\": [], \\"notify\\": false, - \\"notifyMode\\": \\"always\\", + \\"notifyMode\\": \\"failure-change\\", \\"passWithNoTests\\": false, \\"projects\\": null, \\"rootDir\\": \\"<>\\", diff --git a/packages/jest-cli/src/cli/args.js b/packages/jest-cli/src/cli/args.js index 4b8b970bc578..25716500f378 100644 --- a/packages/jest-cli/src/cli/args.js +++ b/packages/jest-cli/src/cli/args.js @@ -389,7 +389,7 @@ export const options = { type: 'boolean', }, notifyMode: { - default: 'always', + default: 'failure-change', description: 'Specifies when notifications will appear for test results.', type: 'string', }, diff --git a/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap b/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap index 283bf34d2b16..adf63d20d15c 100644 --- a/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap +++ b/packages/jest-cli/src/lib/__tests__/__snapshots__/init.test.js.snap @@ -101,7 +101,7 @@ module.exports = { // notify: false, // An enum that specifies notification mode. Requires { notify: true } - // notifyMode: \\"always\\", + // notifyMode: \\"failure-change\\", // A preset that is used as a base for Jest's configuration // preset: null, diff --git a/packages/jest-config/src/Defaults.js b/packages/jest-config/src/Defaults.js index 3cc56781bcde..fd2c040015d0 100644 --- a/packages/jest-config/src/Defaults.js +++ b/packages/jest-config/src/Defaults.js @@ -47,7 +47,7 @@ export default ({ modulePathIgnorePatterns: [], noStackTrace: false, notify: false, - notifyMode: 'always', + notifyMode: 'failure-change', preset: null, prettierPath: 'prettier', projects: null, diff --git a/packages/jest-config/src/ValidConfig.js b/packages/jest-config/src/ValidConfig.js index d711a520a7fc..e264be5e2ead 100644 --- a/packages/jest-config/src/ValidConfig.js +++ b/packages/jest-config/src/ValidConfig.js @@ -68,7 +68,7 @@ export default ({ name: 'string', noStackTrace: false, notify: false, - notifyMode: 'always', + notifyMode: 'failure-change', onlyChanged: false, preset: 'react-native', prettierPath: '/node_modules/prettier', diff --git a/packages/jest-validate/src/__tests__/fixtures/jest_config.js b/packages/jest-validate/src/__tests__/fixtures/jest_config.js index 742dce16ac5a..f7ac1e2a1bc8 100644 --- a/packages/jest-validate/src/__tests__/fixtures/jest_config.js +++ b/packages/jest-validate/src/__tests__/fixtures/jest_config.js @@ -39,7 +39,7 @@ const defaultConfig = { modulePathIgnorePatterns: [], noStackTrace: false, notify: false, - notifyMode: 'always', + notifyMode: 'failure-change', preset: null, prettierPath: 'prettier', resetMocks: false, @@ -98,7 +98,7 @@ const validConfig = { name: 'string', noStackTrace: false, notify: false, - notifyMode: 'always', + notifyMode: 'failure-change', preset: 'react-native', prettierPath: '/node_modules/prettier', resetMocks: false,