From 4713e5e7ea421938219e1b2fa8c247c231fdaff6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 31 Jan 2017 13:22:22 +0100 Subject: [PATCH] Add nyc coverage, report data to coveralls.io --- .gitignore | 1 + .nycrc | 7 +++++++ .travis.yml | 1 + package.json | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .nycrc diff --git a/.gitignore b/.gitignore index a30033bd..ba976d83 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ node_modules dist *xunit.xml +.nyc_output/ diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..b64607ee --- /dev/null +++ b/.nycrc @@ -0,0 +1,7 @@ +{ + "exclude": [ + "Gruntfile.js", + "test/**/*.js" + ], + "cache": true +} diff --git a/.travis.yml b/.travis.yml index 501feed6..ec6072c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ node_js: - "0.12" - "4" - "6" +after_success: npm run coverage # see https://www.npmjs.com/package/phantomjs-prebuilt#continuous-integration cache: diff --git a/package.json b/package.json index 7c68870e..30a0f33e 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,8 @@ "mBaaS" ], "scripts": { - "test": "grunt mocha-and-karma" + "coverage": "nyc report --reporter=text-lcov | coveralls", + "test": "nyc grunt mocha-and-karma" }, "dependencies": { "async": "^2.0.1", @@ -67,6 +68,7 @@ "browserify": "^13.1.0", "chai": "^3.5.0", "es5-shim": "^4.1.0", + "coveralls": "^2.11.15", "express-session": "^1.14.0", "grunt": "^1.0.1", "grunt-browserify": "^5.0.0", @@ -90,6 +92,7 @@ "loopback-datasource-juggler": "^2.19.1", "loopback-testing": "^1.4.0", "mocha": "^3.0.0", + "nyc": "^10.1.2", "phantomjs-prebuilt": "^2.1.7", "sinon": "^1.13.0", "sinon-chai": "^2.8.0",