Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Add coverage for client side tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Oct 11, 2013
1 parent 2756740 commit 3895550
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = function (grunt) {
karma: {
dev: {
singleRun: true,
reporters: ['dots'],
reporters: ['dots', 'coverage'],
configFile: 'karma.conf.js'
}
}
Expand Down
19 changes: 18 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ require('js-yaml');
module.exports = function(config) {
var paths = require('./js_paths.yml');

var files_to_cover = [].concat(
paths.client.scripts.go,
paths.tests.client.spec
);

var preprocessors = {};
files_to_cover.forEach(function (file) {
preprocessors[file] = ['coverage'];
})

config.set({
files: [].concat(
paths.client.styles.vendor,
Expand All @@ -14,12 +24,19 @@ module.exports = function(config) {
paths.tests.client.spec
),

preprocessors: preprocessors,
coverageReporter: {
type : 'lcov',
dir : 'coverage/'
},

browsers: ['PhantomJS'],
frameworks: ['mocha'],

plugins: [
'karma-mocha',
'karma-phantomjs-launcher'
'karma-phantomjs-launcher',
'karma-coverage'
]
});
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"karma-mocha": "~0.1.0",
"grunt-karma": "~0.6.2",
"karma-phantomjs-launcher": "~0.1.0",
"grunt-bower-task": "~0.3.2"
"grunt-bower-task": "~0.3.2",
"karma-coverage": "~0.1.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 3895550

Please sign in to comment.