Publish code coverage to Code Climate
npm install codeclimate-hook
A hook, with send-coverage command, that send the corevage report to Code Climate.
json
"coverage": "CC_TEST_REPORTER_ID=YOUR_REPORTID yarn send-coverage",
`#### Use in the hook helper(in this case husky):
`json
"husky": {
"hooks": {
"pre-push": "yarn coverage"
}
},
`#### Or call it manually:
`bash
yarn coverage
`$3
CC_TEST_REPORTER_ID [required]: You can find it under Repo Settings in your Code Climate project.
- DEBUG [default: false]: useful for initial configuration.
- COVERAGE_COMMAND [default: yarn test ]: The command that runs the tests and generate the coverage report.
- SILENT_MODE [default: true]: For not breaking any flow if anything goes wrong, so if you setup a pre-commit` hook and you don't want your time to kill you when any tests breaks or they are with no internet to send the report.