From d49806a78b439d8fb783f72d4853de32f982572b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Wed, 30 Aug 2017 14:13:52 +0200 Subject: [PATCH] Add nyc coverage, report data to coveralls.io --- .gitignore | 1 + .nycrc | 6 ++++++ .travis.yml | 2 ++ package.json | 5 ++++- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .nycrc diff --git a/.gitignore b/.gitignore index 91e74560..9aae3818 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,6 @@ docs/man npm-debug.log .project test/memory.json +.nyc_output diff --git a/.nycrc b/.nycrc new file mode 100644 index 00000000..fd199844 --- /dev/null +++ b/.nycrc @@ -0,0 +1,6 @@ +{ + "exclude": [ + "test/**/*.js" + ], + "cache": true +} diff --git a/.travis.yml b/.travis.yml index 1d0ad987..8721eae8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,5 @@ language: node_js node_js: - "4" - "6" + +after_success: npm run coverage diff --git a/package.json b/package.json index 88bb0b2c..d3faacc7 100644 --- a/package.json +++ b/package.json @@ -26,16 +26,19 @@ "depd": "./lib/browser.depd.js" }, "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", "lint": "eslint .", - "test": "mocha", + "test": "nyc mocha", "posttest": "npm run lint" }, "devDependencies": { "async-iterators": "^0.2.2", + "coveralls": "^2.13.1", "eslint": "^3.12.2", "eslint-config-loopback": "^8.0.0", "loopback-connector-throwing": "file:./test/fixtures/loopback-connector-throwing", "mocha": "^3.2.0", + "nyc": "^11.1.0", "should": "^8.4.0" }, "dependencies": {