Jest: Exit code with --findRelatedTests

Created on 18 Dec 2017  路  2Comments  路  Source: facebook/jest

Do you want to request a _feature_ or report a _bug_?
Bug

What is the current behavior?
If Jest with --findRelatedTests flag does not detect any related tests it exits with exit code 1.

What is the expected behavior?
In this case, it'd be good to exit with exit code 0. So it won't fail pre-commit hook with lint-staged for example.

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

Jest 22, node 7.7.6, npm 4.1.2, win10

Question

Most helpful comment

Add the --passWithNoTests as well, and it exits with 0 on no tests

All 2 comments

Add the --passWithNoTests as well, and it exits with 0 on no tests

FWIW, as of #5127 findRelatedTests by default exits with 0 even without the flag.

Was this page helpful?
0 / 5 - 0 ratings