You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
react-scripts test (or Jest) is reporting exit code 0 on test failures #7180
changed the title [-]react-scripts test is not reporting non-zero exit code on test failures (when running inside a bash script)[/-][+]react-scripts test (or Jest) is reporting exit code 0 on test failures[/+]on Jun 6, 2019
I think its the same problem as #6944
I have a Husky configured and without CI env, even though tests are failing, Husky is not stopping commits from going through. Adding of CI works, but as @thedanchez pointed out, we are losing pretty output.
Update:
Seems that --bail keeps the pretty output.
Activity
bugzpodder commentedon Jun 6, 2019
You can try setting CI=true to get a non-zero exit code.
heyimalex commentedon Jun 6, 2019
Duplicate of #7026 I think. Last time I checked we're doing everything right, but jest doesn't return the appropriate error code.
thedanchez commentedon Jun 6, 2019
Setting the
CIenv variable works but the usage of that for local test runs doesn't seem right to me. We also lose the pretty output.Been digging around for the past couple of hours and found that adding
--bailin the CLI works as well.[-]react-scripts test is not reporting non-zero exit code on test failures (when running inside a bash script)[/-][+]react-scripts test (or Jest) is reporting exit code 0 on test failures[/+]goranefbl commentedon Jun 10, 2019
I think its the same problem as #6944
I have a Husky configured and without CI env, even though tests are failing, Husky is not stopping commits from going through. Adding of CI works, but as @thedanchez pointed out, we are losing pretty output.
Update:
Seems that --bail keeps the pretty output.
silverwind commentedon Jun 27, 2019
Confirmed, steps to reproduce:
bugzpodder commentedon Jun 27, 2019
I think add --bail works as others pointed out
silverwind commentedon Jun 27, 2019
Imho, a proper exit code should be set by default and not only with obscure arguments like
--bail.bugzpodder commentedon Jun 27, 2019
Agreed, PRs welcome!
mAAdhaTTah commentedon Jul 19, 2019
Also
--bailwill stop running tests on the first error, rather than running the full test suite then erroring.Add explicit check for --watchAll=false
Add explicit check for --watchAll=false (#7433)
Add explicit check for --watchAll=false (react#7433)
Update cra fork (#2)
Feature/customized webpack plugin integration (#2)
Add explicit check for --watchAll=false (react#7433)