Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
chore(test): add test coverage task
Browse files Browse the repository at this point in the history
Run `grunt test:coverage` to see a the test coverage in the terminal.
  • Loading branch information
chrisirhc authored and pkozlowski-opensource committed Dec 25, 2013
1 parent 161a996 commit 70af344
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ module.exports = function(grunt) {
travis: {
singleRun: true,
browsers: ['Firefox']
},
coverage: {
singleRun: true,
preprocessors: {
'src/*/*.js': 'coverage'
},
reporters: ['progress', 'coverage'],
coverageReporter: {
type : 'text'
}
}
},
changelog: {
Expand Down Expand Up @@ -316,11 +326,13 @@ module.exports = function(grunt) {
grunt.task.run(['concat', 'uglify']);
});

grunt.registerTask('test', 'Run tests on singleRun karma server', function() {
grunt.registerTask('test', 'Run tests on singleRun karma server', function (subTask) {
//this task can be executed in 3 different environments: local, Travis-CI and Jenkins-CI
//we need to take settings for each one into account
if (process.env.TRAVIS) {
grunt.task.run('karma:travis');
} else if (subTask === 'coverage') {
grunt.task.run('karma:coverage');
} else {
grunt.task.run(this.args.length ? 'karma:jenkins' : 'karma:continuous');
}
Expand Down

0 comments on commit 70af344

Please sign in to comment.