test-reporter
test-reporter copied to clipboard
Jest + Heroku CI
Hi all -- our code coverage is calculated by Jest and our CI pipeline is Heroku. Could someone provide an example on how I could get that setup to talk to Code Climate? Thanks!
Jest doesn't require any particular configuration, just run it with --coverage to generate the reports. Otherwise it's similar to any other CI environment, as documented here; run:
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-{architecture} > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
before the tests and:
./cc-test-reporter after-build --exit-code {whether or not the tests passed}
afterwards. For Heroku CI specifically looks like you can do that by setting test-setup and test in the app.json per their docs.