mirror of
https://github.com/hanzoai/session.git
synced 2026-09-24 17:02:35 +00:00
build: use nyc for coverage testing
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
.nyc_output
|
||||
coverage
|
||||
node_modules
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.nyc_output
|
||||
coverage
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
+8
-6
@@ -60,16 +60,18 @@ before_install:
|
||||
# Configure eslint for linting
|
||||
if node_version_lt '4.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.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 coverage
|
||||
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
|
||||
- |
|
||||
# Configure supertest for http calls
|
||||
if node_version_lt '0.10'; then npm_use_module 'supertest' '1.1.0'
|
||||
@@ -97,7 +99,7 @@ script:
|
||||
after_script:
|
||||
- |
|
||||
# Upload coverage to coveralls, if exists
|
||||
if [[ -f ./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
|
||||
|
||||
+3
-3
@@ -25,8 +25,8 @@
|
||||
"eslint": "3.19.0",
|
||||
"eslint-plugin-markdown": "1.0.0",
|
||||
"express": "4.16.4",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "6.1.4",
|
||||
"nyc": "14.0.0",
|
||||
"supertest": "4.0.2"
|
||||
},
|
||||
"files": [
|
||||
@@ -41,8 +41,8 @@
|
||||
"scripts": {
|
||||
"lint": "eslint --plugin markdown --ext js,md . && node ./scripts/lint-readme.js",
|
||||
"test": "mocha --require test/support/env --check-leaks --bail --no-exit --reporter spec test/",
|
||||
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --check-leaks --no-exit --reporter dot test/",
|
||||
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --check-leaks --no-exit --reporter spec test/",
|
||||
"test-cov": "nyc npm test",
|
||||
"test-travis": "nyc npm test -- --no-exit",
|
||||
"version": "node scripts/version-history.js && git add HISTORY.md"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user