Skip to content

Commit 3dcf491

Browse files
committed
Add suggestion of using --passWithNoTests on no tests found
1 parent d184511 commit 3dcf491

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/jest-cli/src/run_jest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ export default (async function runJest({
156156
if (globalConfig.passWithNoTests) {
157157
new Console(outputStream, outputStream).log(noTestsFoundMessage);
158158
} else {
159-
new Console(outputStream, outputStream).error(noTestsFoundMessage);
159+
new Console(outputStream, outputStream).error(
160+
`${noTestsFoundMessage}\n\nIf you consider no tests matching your filters acceptable behaviour (such as when using --findRelatedTests on a precommit hook), and you prefer this case not constituting a failed test, consider using the '--passWithNotests' option`,
161+
);
160162

161163
process.exit(1);
162164
}

0 commit comments

Comments
 (0)