Skip to content

Commit 2de07df

Browse files
committed
chore(build): Add code coverage with codecov.io
1 parent 4d1c4a3 commit 2de07df

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ node_modules
4040

4141
# Transpiled code
4242
/es
43-
/lib
43+
/lib
44+
45+
coverage
46+
.nyc_output

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ after_success:
2424
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
2525
- python travis_after_all.py
2626
- export $(cat .to_export_back) &> /dev/null
27+
- npm run cover-report
2728
- npm run semantic-release
2829
branches:
2930
only:

package.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"chai": "3.5.0",
4242
"chai-as-promised": "5.3.0",
4343
"chai-spies": "0.7.1",
44+
"codecov.io": "0.1.6",
4445
"cz-conventional-changelog": "1.2.0",
4546
"eslint": "3.4.0",
4647
"eslint-config-airbnb": "10.0.1",
@@ -51,6 +52,7 @@
5152
"flow-bin": "0.32.0",
5253
"ghooks": "1.3.2",
5354
"mocha": "3.0.2",
55+
"nyc": "8.1.0",
5456
"rimraf": "2.5.4",
5557
"sane": "1.4.1",
5658
"semantic-release": "4.3.5"
@@ -60,6 +62,8 @@
6062
"build-cjs": "rimraf lib && babel src --ignore __tests__,__mocks__ -d lib",
6163
"build-es": "rimraf es && BABEL_ENV=es babel src --ignore __tests__,__mocks__ -d es",
6264
"build-flow": "find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib\\//g'`.flow; done",
65+
"cover": "nyc npm t",
66+
"cover-report": "cat ./coverage/lcov.info | codecov",
6367
"lint": "eslint src test *.js",
6468
"prepublish": "npm run build",
6569
"test": "babel-node ./node_modules/.bin/_mocha --compilers js:babel-core/register --reporter dot --require ./resources/mocha-bootload src/**/__tests__/**/*-test.js",
@@ -74,8 +78,17 @@
7478
"commitizen": {
7579
"path": "./node_modules/cz-conventional-changelog"
7680
},
77-
"ghooks": {
78-
"pre-commit": "npm run test"
79-
}
81+
},
82+
"nyc": {
83+
"exclude": [
84+
"**/__mocks__/**",
85+
"**/__tests__/**",
86+
"resources",
87+
"node_modules"
88+
],
89+
"reporter": [
90+
"lcov",
91+
"text"
92+
]
8093
}
8194
}

0 commit comments

Comments
 (0)