Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
(ci)Report Test Coverage to Code Climate (#162)
Browse files Browse the repository at this point in the history
Update Travis CI configuration to report unit test coverage to Code
Climate.
  • Loading branch information
elfrank authored Sep 7, 2020
1 parent 7143b01 commit cbbd3f5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_modules

# file with environment variables
.env

# artifacts from tests
coverage/
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
env:
global:
- CC_TEST_REPORTER_ID=5df0c45e1b9cd012ffcd16ad6a65b5ddb87f36fa3e335c43458de53641cacc45
language: node_js
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
module.exports = {
collectCoverage: true,
coverageReporters: ["lcov"],
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"],
moduleDirectories: ['node_modules', '']
};

0 comments on commit cbbd3f5

Please sign in to comment.