Improve coverage support

This commit is contained in:
Emanuele Zattin 2017-10-10 20:23:11 +02:00
parent ea62b572a5
commit 6aa0286cf0
3 changed files with 33 additions and 5 deletions

2
Jenkinsfile vendored
View File

@ -52,7 +52,7 @@ stage('build') {
jsdoc: doDockerBuild('jsdoc', {
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'docs/output', reportFiles: 'index.html', reportName: 'Docs'])
}),
linux_node_debug: doDockerBuild('node Debug', {
linux_node_debug: doDockerBuild('node-cover Debug', {
withCredentials([string(credentialsId: 'codecov-token-js', variable: 'CODECOV_TOKEN')]) {
sh 'tests/node_modules/codecov/bin/codecov'
}

View File

@ -370,6 +370,32 @@ case "$TARGET" in
cd "$(mktemp -q -d -t realm.node.XXXXXX)"
test_temp_dir=$PWD # set it to be cleaned at exit
pushd "$SRCROOT/tests"
npm install
eval "$npm_tests_cmd"
popd
stop_server
;;
"node-cover")
npm run check-environment
if [ "$(uname)" = 'Darwin' ]; then
echo "downloading server"
download_server
echo "starting server"
start_server
npm_tests_cmd="npm run test-cover"
npm install --build-from-source=realm --realm_enable_sync
else
npm_tests_cmd="npm run test-cover"
npm install --build-from-source=realm
fi
# Change to a temp directory.
cd "$(mktemp -q -d -t realm.node.XXXXXX)"
test_temp_dir=$PWD # set it to be cleaned at exit
pushd "$SRCROOT/tests"
npm install
eval "$npm_tests_cmd"

View File

@ -12,12 +12,14 @@
"tmp": "^0.0.30",
"url-parse": "^1.1.7",
"typescript": "^2.5.2",
"istanbul": "^0.3.2",
"codecov": "^1.0.0"
"istanbul": "^0.4.5",
"codecov": "^2.3.0"
},
"scripts": {
"check-typescript" : "tsc --noEmit --alwaysStrict ./../lib/index.d.ts",
"js-tests" : "istanbul cover jasmine spec/unit_tests.js",
"test": "npm run check-typescript && npm run js-tests"
"js-tests" : "jasmine spec/unit_tests.js",
"js-tests-cover" : "istanbul cover jasmine spec/unit_tests.js",
"test": "npm run check-typescript && npm run js-tests",
"test-cover": "npm run check-typescript && npm run js-tests-cover"
}
}