Skip to content

Commit

Permalink
Merge pull request #18 from pcman-bbs/fix-coverage
Browse files Browse the repository at this point in the history
Use isparta instead of gulp-jsx-coverage.

close issue #6
  • Loading branch information
kidwm committed Aug 27, 2015
2 parents bde6102 + b487fd1 commit 97c88c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
31 changes: 6 additions & 25 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var babel = require('gulp-babel');
var coverage = require('gulp-jsx-coverage');
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var mocha = require('gulp-spawn-mocha');
Expand Down Expand Up @@ -36,31 +35,13 @@ gulp.task('mocha', function () {
.pipe(mocha());
});

gulp.task('coverage', coverage.createTask({
src: src.concat(test),
gulp.task('coverage', shell.task(
'babel-node ./node_modules/isparta/bin/isparta cover --report text --report html --report lcov ./node_modules/mocha/bin/_mocha'
));

istanbul: {
coverageVariable: '__COVERAGE__',
exclude: /node_modules|test/,
},

transpile: {
babel: {
include: /\.js$/,
exclude: /node_modules/,
},
},

coverage: {
reporters: ['text-summary', 'json', 'lcov'],
directory: 'coverage',
},
}));

gulp.task('coveralls', ['coverage'], function () {
gulp.src('gulpfile.js', {read: false})
.pipe(shell('node_modules/.bin/coveralls < coverage/lcov.info'));
});
gulp.task('coveralls', ['coverage'], shell.task(
'node_modules/.bin/coveralls < coverage/lcov.info'
));

gulp.task('watch', function () {
gulp.watch([].concat(src, test), ['test']);
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"prepublish": "gulp prepublish",
"test": "gulp test"
"test": "gulp test",
"coverage": "gulp coverage"
},
"repository": {
"type": "git",
Expand All @@ -32,10 +33,10 @@
"gulp": "^3.9.0",
"gulp-babel": "^5.2.0",
"gulp-jshint": "^1.11.2",
"gulp-jsx-coverage": "^0.2.2",
"gulp-sequence": "^0.4.0",
"gulp-shell": "^0.4.2",
"gulp-spawn-mocha": "^2.2.1",
"isparta": "^3.0.3",
"jshint-stylish": "^2.0.1",
"mocha": "^2.2.5",
"sinon": "^1.15.4"
Expand Down

0 comments on commit 97c88c8

Please sign in to comment.