Skip to content

Commit b3a6934

Browse files
committed
Add coverage
1 parent c93b0f0 commit b3a6934

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,3 @@ typings/
6262

6363

6464
# End of https://www.gitignore.io/api/node
65-
66-
.npmrc
67-
dist

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ dist: trusty
33
node_js:
44
- "stable"
55

6+
install:
7+
- npm install --ignore-scripts
8+
69
script:
10+
- nyc npm run install
711
- "source ~/.bash_profile || source ~/.bashrc || source ~/.zshrc"
812
- npm test
13+
14+
after_script:
15+
- npm run report-coverage

appveyor.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ install:
1212
# install Node.js
1313
- ps: Install-Product node $env:nodejs_version
1414
# install modules
15-
- npm install
15+
- npm install --ignore-scripts
1616

1717
# to run your custom scripts instead of automatic tests
1818
test_script:
19+
- node_modules/.bin/nyc npm run install
1920
- npm test
21+
22+
# to run your custom scripts instead of provider deployments
23+
after_test:
24+
- npm run report-coverage

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
},
1212
"description": "Mirrors in China about node.js",
1313
"devDependencies": {
14+
"codecov": "^3.0.0",
1415
"eslint": "^4.13.1",
1516
"eslint-config-standard": "^11.0.0-beta.0",
1617
"eslint-plugin-import": "^2.8.0",
1718
"eslint-plugin-node": "^5.2.1",
1819
"eslint-plugin-promise": "^3.6.0",
1920
"eslint-plugin-standard": "^3.0.1",
20-
"mocha": "^4.0.1"
21+
"mocha": "^4.0.1",
22+
"nyc": "^11.4.1"
2123
},
2224
"homepage": "https://github.com/gucong3000/mirror-config-china#readme",
2325
"keywords": [
@@ -29,6 +31,13 @@
2931
"license": "MIT",
3032
"main": "./index.js",
3133
"name": "mirror-config-china",
34+
"nyc": {
35+
"reporter": [
36+
"lcov",
37+
"text-summary"
38+
],
39+
"cache": true
40+
},
3241
"repository": {
3342
"type": "git",
3443
"url": "git+https://github.com/gucong3000/mirror-config-china.git"
@@ -37,6 +46,7 @@
3746
"preinstall": "node -e \"require('util').promisify.call\" || npm i util.promisify",
3847
"install": "node lib/install",
3948
"pretest": "eslint lib test *.js",
49+
"report-coverage": "codecov",
4050
"test": "mocha"
4151
},
4252
"version": "2.2.0"

0 commit comments

Comments
 (0)