Skip to content

Commit

Permalink
built: use nyc for test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Aug 7, 2017
1 parent a1cd165 commit b86923b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.nyc_output
coverage
node_modules
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.nyc_output/
coverage/
node_modules/
package-lock.json
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ before_install:
- "npm rm --save-dev beautify-benchmark"

# Setup Node.js version-specific dependencies
- "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev istanbul"
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)"

# Update Node.js modules
- "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"
- "test -z $(npm -ps ls eslint ) || npm run-script lint"
# Run test script, depending on nyc install
- "test ! -z $(npm -ps ls nyc) || npm test"
- "test -z $(npm -ps ls nyc) || 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"
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"eslint-plugin-node": "5.1.1",
"eslint-plugin-promise": "3.5.0",
"eslint-plugin-standard": "3.0.1",
"istanbul": "0.4.5",
"mocha": "3.5.0"
"mocha": "3.5.0",
"nyc": "10.3.2"
},
"files": [
"LICENSE",
Expand All @@ -39,7 +39,7 @@
"bench": "node benchmark/index.js",
"lint": "eslint .",
"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"
}
}

0 comments on commit b86923b

Please sign in to comment.