Skip to content

Commit

Permalink
build: use nyc for coverage testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Apr 30, 2019
1 parent 3757bbb commit fd15255
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 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
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@

.DS_Store*
*.log
*.gz

package-lock.json

.nyc_output
node_modules
coverage
cache
package-lock.json
14 changes: 8 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ before_install:
# Configure eslint for linting
if node_version_lt '6.0'; then npm_remove_module_re '^eslint(-|$)'
fi
- |
# Configure istanbul for coverage
if node_version_lt '0.10'; then npm_remove_module_re '^istanbul$'
fi
- |
# Configure mocha for testing
if node_version_lt '0.8' ; then npm_use_module 'mocha' '1.21.5'
elif node_version_lt '0.10'; then npm_use_module 'mocha' '2.5.3'
elif node_version_lt '4.0' ; then npm_use_module 'mocha' '3.5.3'
elif node_version_lt '6.0' ; then npm_use_module 'mocha' '5.2.0'
fi
- |
# Configure nyc for testing
if node_version_lt '0.10'; then npm_remove_module_re '^nyc$'
elif node_version_lt '4.0' ; then npm_use_module 'nyc' '10.3.2'
elif node_version_lt '6.0' ; then npm_use_module 'nyc' '11.9.0'
fi
# Update Node.js modules
- |
# Prune & rebuild node_modules
Expand All @@ -98,7 +100,7 @@ script:
after_script:
- |
# Upload coverage to coveralls if exists
if [[ -e ./coverage/lcov.info ]]; then
if [[ -d .nyc_output ]]; then
npm install --save-dev coveralls@2
coveralls < ./coverage/lcov.info
nyc report --reporter=text-lcov | coveralls
fi
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"eslint-plugin-node": "8.0.1",
"eslint-plugin-promise": "4.1.1",
"eslint-plugin-standard": "4.0.0",
"istanbul": "0.4.5",
"mocha": "6.1.4"
"mocha": "6.1.4",
"nyc": "14.0.0"
},
"files": [
"LICENSE",
Expand All @@ -35,8 +35,8 @@
"scripts": {
"lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --reporter spec --check-leaks --bail 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=html --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test"
},
"keywords": [
"content",
Expand Down

0 comments on commit fd15255

Please sign in to comment.