blurts-server
blurts-server copied to clipboard
When running `npm test`, skip coveralls when not configured
Add a new script scripts/is_coveralls_configured.js that checks if COVERALLS_REPO_TOKEN is defined or .coveralls.yml exists, and sets exit code 1 (failure) if not configured. It can be run with npm test:is_coveralls_configured
This is then used in npm test to skip running coveralls if it isn't configured, which is normal in the development environment.
Force-pushed to fix the command. coveralls ran in CircleCI and coverage was uploaded to coveralls.io.
It is skipped for me locally (since I never setup .coverage.yml).
We're missing a coverage badge. I could add it to README.md with this PR:
[](https://coveralls.io/github/mozilla/blurts-server?branch=master)
which renders as:
Rebased on current main and made changes based on feedback:
- Script is now
scripts/is-coveralls-configured.js, using kabob-naming for consistency with other scripts npm testnow callsscripts/is_coveralls_configured.jsdirectly, andnpm test:is_coveralls_configuredis dropped- Remove a comment about
.coverage.ymland the Rubycoverallsas unneeded - Remove unneeded call to
process.exit(0), only needed for non-zero exit code - Add the coverage badge to
README.md, defaulting to themainbranch (notmaster, like in my comment)