From 7c86f19047ea7ef5b8f7cd486849574a2dfbb35c Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 13 Oct 2017 21:43:50 -0400 Subject: [PATCH] build: use nyc for test coverage --- .gitignore | 1 + .travis.yml | 7 +++---- package.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3cd27af..4848b02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.nyc_output/ coverage/ node_modules/ npm-debug.log diff --git a/.travis.yml b/.travis.yml index 3dc4aac..2dce9d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,8 @@ before_install: - "test ! -d node_modules || npm prune" - "test ! -d node_modules || npm rebuild" script: - # Run test script, depending on istanbul install - - "test ! -z $(npm -ps ls istanbul) || npm test" - - "test -z $(npm -ps ls istanbul) || npm run-script test-travis" + # Run test script, then lint depending on eslint install + - "npm run-script test-travis" - "test -z $(npm -ps ls eslint) || npm run-script lint" after_script: - - "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls" + - "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls" diff --git a/package.json b/package.json index 2bb5935..515b1f1 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "eslint": "3.19.0", "eslint-plugin-markdown": "1.0.0-beta.6", "finalhandler": "1.0.6", - "istanbul": "0.4.5", "mocha": "3.5.3", + "nyc": "10.3.2", "supertest": "1.2.0" }, "files": [ @@ -39,7 +39,7 @@ "scripts": { "lint": "eslint --plugin markdown --ext js,md .", "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + "test-cov": "nyc --reporter=text npm test", + "test-travis": "nyc --reporter=html --reporter=text npm test" } }