Skip to content

Commit

Permalink
Report coverage data to coveralls.io (#296)
Browse files Browse the repository at this point in the history
- Modify `npm test` to run all tests with code coverage enabled via
`nyc`
 - Modify `npm run coverage` to report the coverage to coveralls.io
 - Add a Travis hook `after_success` to run the npm script
   reporting the coverage
  • Loading branch information
bajtos committed May 25, 2017
1 parent 42ca843 commit 80ecc40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_js:

before_script:
- npm run bootstrap

after_success:
- npm run coverage
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/node": "^7.0.4",
"@types/request": "0.0.40",
"@types/request-promise": "^4.1.33",
"coveralls": "^2.13.1",
"lerna": "^2.0.0-rc.4",
"mocha": "^3.2.0",
"nyc": "^10.3.2",
Expand All @@ -27,9 +28,9 @@
"bootstrap": "lerna bootstrap",
"lint": "tslint -c tslint.full.json --project tsconfig.json --type-check --exclude \"examples/**/*\" --exclude \"**/node_modules/**\" --exclude \"**/*.d.ts\" \"**/*.ts\"",
"lint:fix": "npm run lint -- --fix",
"test": "mocha --opts test/mocha.opts \"packages/*/test/**/*.ts\"",
"test": "nyc mocha --opts test/mocha.opts \"packages/*/test/**/*.ts\"",
"posttest": "npm run lint",
"coverage": "nyc npm test"
"coverage": "nyc report --reporter=text-lcov | coveralls"
},
"nyc": {
"include": [
Expand All @@ -43,7 +44,7 @@
],
"reporter": [
"html",
"lcov"
"text"
]
}
}

0 comments on commit 80ecc40

Please sign in to comment.