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

Commit cbbd3f5

Browse files
authored
(ci)Report Test Coverage to Code Climate (#162)
Update Travis CI configuration to report unit test coverage to Code Climate.
1 parent 7143b01 commit cbbd3f5

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ node_modules
66

77
# file with environment variables
88
.env
9+
10+
# artifacts from tests
11+
coverage/

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1+
env:
2+
global:
3+
- CC_TEST_REPORTER_ID=5df0c45e1b9cd012ffcd16ad6a65b5ddb87f36fa3e335c43458de53641cacc45
14
language: node_js
5+
before_script:
6+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
7+
- chmod +x ./cc-test-reporter
8+
- ./cc-test-reporter before-build
9+
after_script:
10+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
2+
collectCoverage: true,
3+
coverageReporters: ["lcov"],
4+
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"],
25
moduleDirectories: ['node_modules', '']
36
};

0 commit comments

Comments
 (0)