diff --git a/.travis.yml b/.travis.yml index 847cc97718..7fc3bb86ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,3 +11,8 @@ before_script: - cp config.json.example config.json - "until nc -z localhost 27017; do echo Waiting for MongoDB; sleep 1; done" - "export DISPLAY=:99" +after_script: + - "./node_modules/.bin/lcov-result-merger 'coverage/**/*.info' | codeclimate" +addons: + code_climate: + repo_token: bb97549208bf4dea16807ff0a5fdd291be0f5b836ce6cfa73020bd3010716090 diff --git a/package.json b/package.json index 68275899f9..6d6e29f7c9 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "event-stream": "^3.2.2", "expect.js": "~0.2.0", "glob": "^4.3.5", + "istanbul": "^0.3.14", "karma": "~0.10.2", "karma-chai-plugins": "~0.1.0", "karma-chrome-launcher": "~0.1.0", @@ -105,6 +106,7 @@ "karma-phantomjs-launcher": "~0.1.0", "karma-requirejs": "~0.2.0", "karma-script-launcher": "~0.1.0", + "lcov-result-merger": "^1.0.2", "mocha": "~1.12.1", "mongoskin": "~0.6.1", "phantomjssmith": "~0.5.4", diff --git a/tasks/gulp-tests.js b/tasks/gulp-tests.js index 188910d026..3c84fac82d 100644 --- a/tasks/gulp-tests.js +++ b/tasks/gulp-tests.js @@ -63,7 +63,7 @@ gulp.task('test:common', ['test:prepare:build'], (cb) => { gulp.task('test:api', ['test:prepare:mongo'], (cb) => { let runner = exec( - testBin('mocha test/api'), + testBin("istanbul cover -i 'website/src/**' --dir coverage/api ./node_modules/.bin/_mocha -- test/api"), (err, stdout, stderr) => { testResults.push({ suite: 'API Specs\t',