Skip to content

Commit

Permalink
chore: add task 'cover' to run tests with code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Krummsdorf committed Jun 5, 2015
1 parent 17cf46c commit 9e91bcb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
jspm_packages
bower_components
.idea
.DS_STORE
.DS_STORE
build/reports
21 changes: 21 additions & 0 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,24 @@ gulp.task('tdd', function (done) {
done();
});
});

/**
* Run test once with code coverage and exit
*/
gulp.task('cover', function (done) {
karma.start({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true,
reporters: ['coverage'],
preprocessors: {
'test/**/*.js': ['babel'],
'src/**/*.js': ['babel', 'coverage']
},
coverageReporter: {
type: 'html',
dir: 'build/reports/coverage'
}
}, function (e) {
done();
});
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"jshint-stylish": "^1.0.0",
"karma": "^0.12.28",
"karma-babel-preprocessor": "^5.1.0",
"karma-coverage": "^0.3.1",
"karma-chrome-launcher": "^0.1.7",
"karma-jasmine": "^0.3.5",
"karma-jspm": "^1.1.4",
Expand Down

0 comments on commit 9e91bcb

Please sign in to comment.