diff --git a/CHANGELOG.md b/CHANGELOG.md index f84e2a276a8f..0d88a7bd7e1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,7 @@ - `[jest-cli]` Support dashed args ([#7497](https://github.com/facebook/jest/pull/7497)) - `[jest-cli]` Fix to run in band tests if watch mode enable when runInBand arg used ([#7518](https://github.com/facebook/jest/pull/7518)) - `[jest-runtime]` Fix mistake as test files when run coverage issue. ([#7506](https://github.com/facebook/jest/pull/7506)) +- `[jest-cli]` print info about passWithNoTests flag ([#7309](https://github.com/facebook/jest/pull/7309)) ### Chore & Maintenance diff --git a/packages/jest-cli/src/getNoTestFound.js b/packages/jest-cli/src/getNoTestFound.js index 8c4830d4817a..fcf0057bbcb0 100644 --- a/packages/jest-cli/src/getNoTestFound.js +++ b/packages/jest-cli/src/getNoTestFound.js @@ -21,7 +21,9 @@ export default function getNoTestFound(testRunData, globalConfig): string { } return ( - chalk.bold('No tests found') + + chalk.bold('No tests found, exiting with code 1') + + '\n' + + 'Run with `--passWithNoTests` to exit with code 0' + '\n' + `In ${chalk.bold(process.cwd())}` + '\n' + diff --git a/packages/jest-cli/src/getNoTestFoundVerbose.js b/packages/jest-cli/src/getNoTestFoundVerbose.js index 7fc61fff4270..a491ac75d232 100644 --- a/packages/jest-cli/src/getNoTestFoundVerbose.js +++ b/packages/jest-cli/src/getNoTestFoundVerbose.js @@ -48,7 +48,9 @@ export default function getNoTestFoundVerbose( } return ( - chalk.bold('No tests found') + + chalk.bold('No tests found, exiting with code 1') + + '\n' + + 'Run with `--passWithNoTests` to exit with code 0' + '\n' + individualResults.join('\n') + '\n' +