Skip to content

Commit

Permalink
Add codeclimate coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jiahaog committed Feb 1, 2016
1 parent 6625446 commit 362b48c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 13 additions & 2 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 => {
Expand All @@ -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';

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 362b48c

Please sign in to comment.