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

Commit 70af344

Browse files
chrisirhcpkozlowski-opensource
authored andcommitted
chore(test): add test coverage task
Run `grunt test:coverage` to see a the test coverage in the terminal.
1 parent 161a996 commit 70af344

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: Gruntfile.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ module.exports = function(grunt) {
135135
travis: {
136136
singleRun: true,
137137
browsers: ['Firefox']
138+
},
139+
coverage: {
140+
singleRun: true,
141+
preprocessors: {
142+
'src/*/*.js': 'coverage'
143+
},
144+
reporters: ['progress', 'coverage'],
145+
coverageReporter: {
146+
type : 'text'
147+
}
138148
}
139149
},
140150
changelog: {
@@ -316,11 +326,13 @@ module.exports = function(grunt) {
316326
grunt.task.run(['concat', 'uglify']);
317327
});
318328

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

0 commit comments

Comments
 (0)