From 80ecc403976c5dc97481600c4b367c73d214f952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 25 May 2017 14:19:27 +0200 Subject: [PATCH] Report coverage data to coveralls.io (#296) - 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 --- .travis.yml | 3 +++ package.json | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b4d7988396ad..c181bda9d1d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,6 @@ node_js: before_script: - npm run bootstrap + +after_success: + - npm run coverage diff --git a/package.json b/package.json index a4704c3739ec..0a0920cc437f 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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": [ @@ -43,7 +44,7 @@ ], "reporter": [ "html", - "lcov" + "text" ] } }