We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utilizing create-react-app, when running tests,
Yes.
Tests. Coverage.
System: OS: macOS 10.14.6 CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz Binaries: Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node Yarn: Not Found npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm Browsers: Chrome: 77.0.3865.120 Firefox: 69.0.2 Safari: 13.0.2 npmPackages: react: ^16.8.6 => 16.9.0 react-dom: ^16.8.6 => 16.9.0 react-scripts: 3.0.1 => 3.0.1 npmGlobalPackages: create-react-app: 3.0.1
package.json
"scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "test:coverage": "npm run test -- --coverage --watchAll=false", }, "jest": { "collectCoverageFrom": [ "src/components/**/*.js", "src/state/**/*.js", "src/templates/**/*.js", "src/routes/**/*.js" ], "coverageThreshold": { "global": { "branches": 80, "functions": 80, "lines": 80, "statements": 80 } } }
Run test:coverage, the console shows a message that test coverage failed, but the test passes.
test:coverage
If the code coverage thresholds are not met, the console returns a non-zero response.
The text was updated successfully, but these errors were encountered:
Hi @plummer-flex : Is this open for grabs?
Sorry, something went wrong.
@anusha5696 what do you mean? To be worked?
Hi @plummer-flex, have you found any way to fail the script if coverageThreshold is not matched?
fwiw: this is working with Node.js 18, NPM 8, and react-scripts 5.
I'm running tests with coverage using a custom script: react-scripts test --coverage --watchAll=false
react-scripts test --coverage --watchAll=false
No branches or pull requests
Describe the bug
Utilizing create-react-app, when running tests,
Did you try recovering your dependencies?
Yes.
Which terms did you search for in User Guide?
Tests. Coverage.
Environment
Steps to reproduce
package.json
Run
test:coverage
, the console shows a message that test coverage failed, but the test passes.Expected behavior
If the code coverage thresholds are not met, the console returns a non-zero response.
Actual behavior
The text was updated successfully, but these errors were encountered: