react-scripts test (or Jest) is reporting exit code 0 on test failures
See original GitHub issueIs this a bug report?
Possibly
Did you try recovering your dependencies?
Yes
Environment
System:
OS: macOS High Sierra 10.13.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
Browsers:
Chrome: 75.0.3770.80
Firefox: 66.0.2
Safari: 12.1
npmPackages:
react: ^16.6.3 => 16.6.3
react-dom: ^16.6.3 => 16.6.3
react-scripts: 2.1.8 => 2.1.8
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
- Create a CRA project with tests
- Create a bash script that encapsulates the
react-scripts test
command execution - Output the exit code result from within that wrapping bash script
Expected Behavior
I expect the exit code to be non-zero when tests fail
Actual Behavior
react-scripts test
is reporting a 0 exit code
Reproducible Demo
None yet
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Jest RTL tests passing but getting Process finished with ...
My tests are all passing successfully, at least in practise. I ran the tests 20 times and 19 times it passed. Once it...
Read more >Configuring Jest
This option tells Jest that all imported modules in your tests should be mocked ... or pass the expected return value ... Default:...
Read more >How To Test a React App with Jest and React Testing Library
In this tutorial, you will test asynchronous code and interactions in a sample project containing various UI elements. You will use Jest to ......
Read more >Jest Addon | Storybook: Frontend workshop for UI ...
React storybook addon that show component jest report. ... need to consider that if your tests fail, the script receives a non-0 exit...
Read more >Testing Recipes
This page assumes you're using Jest as a test runner. ... "react"; export default function Hello(props) { if (props.name) { return <h1>Hello, {props.name}!...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Imho, a proper exit code should be set by default and not only with obscure arguments like
--bail
.Also
--bail
will stop running tests on the first error, rather than running the full test suite then erroring.