Tests exiting code 1 when no tests are found
Created by: stramel
Is this a bug report?
Yes
Did you try recovering your dependencies?
N/A
Which terms did you search for in User Guide?
test, tests, ci, jest
Environment
Noticed on CI server but also happening locally.
using react-scripts v2
Steps to Reproduce
- Run
yarn test
from project without tests.
Expected Behavior
Shouldn't exit code 0 or have a flag to enable/disable the behavior
Actual Behavior
Exited code 1
❯ cross-env CI=true yarn test --ci
yarn run v1.9.4
$ react-scripts test --ci
No tests found
In /Users/stramel/Projects/my-package
9 files checked.
testMatch: /Users/stramel/Projects/my-package/src/**/__tests__/**/*.{js,jsx},/Users/stramel/Projects/my-package/src/**/?(*.)(spec|test).{js,jsx} - 0 matches
testPathIgnorePatterns: /node_modules/ - 9 matches
Pattern: - 0 matches
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.