Add codeclimate coverage

This commit is contained in:
Jia Hao 2016-02-01 15:23:29 +08:00
parent 6625446b01
commit 362b48c411
3 changed files with 19 additions and 2 deletions

View File

@ -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

View File

@ -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';

View File

@ -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",