diff --git a/.travis.yml b/.travis.yml index 9e52306..fc79a23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,3 +16,8 @@ install: - npm run dev-up script: - npm run ci +after_script: + - codeclimate-test-reporter < ./coverage/lcov.info +addons: + code_climate: + repo_token: 8b6e0e15aa138f7e5e03d04154d43b59c0cc0a565941229fd76d5fbfd8031155 diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 6b97181..2fd5fa7 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -7,6 +7,7 @@ import runSequence from 'run-sequence'; import path from 'path'; import eslint from 'gulp-eslint'; import mocha from 'gulp-mocha'; +import istanbul from 'gulp-istanbul'; import shellJs from 'shelljs'; const PATHS = setUpPaths(); @@ -105,8 +106,17 @@ gulp.task('test', callback => { }); gulp.task('mocha', ['build'], () => { - return gulp.src(PATHS.TEST_DEST_JS, {read: false}) - .pipe(mocha()); + return gulp.src(PATHS.CLI_DEST_JS) + .pipe(istanbul({includeUntested: true})) + .on('finish', () => { + return gulp.src(PATHS.TEST_DEST_JS, {read: false}) + .pipe(mocha()) + .pipe(istanbul.writeReports({ + dir: './coverage', + reporters: ['lcov'], + reportOpts: {dir: './coverage'} + })); + }); }); gulp.task('ci', callback => { @@ -130,6 +140,7 @@ function setUpPaths() { paths.APP_STATIC_JS = path.join(paths.APP_SRC, 'static') + '/**/*.js'; paths.APP_STATIC_DEST = path.join(paths.APP_DEST, 'static'); paths.CLI_SRC_JS = paths.CLI_SRC + '/**/*.js'; + paths.CLI_DEST_JS = paths.CLI_DEST + '/**/*.js'; paths.TEST_SRC_JS = paths.TEST_SRC + '/**/*.js'; paths.TEST_DEST_JS = paths.TEST_DEST + '/**/*.js'; diff --git a/package.json b/package.json index b274488..f38d947 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "gulp": "^3.9.0", "gulp-babel": "^6.1.1", "gulp-eslint": "^1.1.1", + "gulp-istanbul": "^0.10.3", "gulp-mocha": "^2.2.0", "gulp-sourcemaps": "^1.6.0", "lodash": "^4.0.0",