Passing "CI=true" fails to prevent successful build when tests fail if building on Linux (bash)
Is this a bug report?
Yes.
Did you try recovering your dependencies?
Yes.
Which terms did you search for in User Guide?
N/A
Environment
System: OS: Linux 4.18 Ubuntu 18.10 (Cosmic Cuttlefish) CPU: x64 Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz Binaries: Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm Browsers: Chrome: 70.0.3538.102 Firefox: 63.0 npmPackages: react: ^16.6.3 => 16.6.3 react-dom: ^16.6.3 => 16.6.3 react-scripts: 2.1.1 => 2.1.1 npmGlobalPackages: create-react-app: Not Found
Steps to Reproduce
- Write tests, (shallow, using enzyme), as described in the official docs, here: https://facebook.github.io/create-react-app/docs/running-tests
- Ensure one of the tests fails when running:
npm run test - Attempt to build, by running:
CI=true npm run build
Expected Behavior
The build would fail, due to the failure of the test.
Actual Behavior
The build succeeds without any issues.
Building does not run your tests -- this is the expected behavior.
Building does not run your tests -- this is the expected behavior.
Am I misunderstanding this, in the docs then:
When creating a build of your application with npm run build linter warnings are not checked by default. Like npm test, you can force the build to perform a linter warning check by setting the environment variable CI. If any warnings are encountered then the build fails.
As per https://facebook.github.io/create-react-app/docs/running-tests#linux-macos-bash
It's just using npm test as an example, "Like npm test" -- the behavior you're opting into is "perform a linter warning check [and fail the build]".
Send a PR clarifying docs?
It's just using
npm testas an example, "Like npm test" -- the behavior you're opting into is "perform a linter warning check [and fail the build]".Send a PR clarifying docs?
Oh right, my mistake, sorry. I was conflating linter warnings and the jest tests, reading it as "force the build to perform a linter warning check [AND TESTS] by setting the environment variable CI...".
I doubt doc clarification is necessary; my stupidity is an extreme edge case :laughing:
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.