Permalink
Browse files

Adding coverage support

  • Loading branch information...
1 parent 1199727 commit e66f78756c491cdbdca2f25155064ccd5879c934 @monsur committed Jan 4, 2015
Showing with 20 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +11 −2 Gruntfile.js
  3. +7 −0 coverage/blanket.js
  4. +1 −0 package.json
  5. 0 {tests → test}/server/sonos-controller.test.js
View
@@ -1,4 +1,5 @@
*~
+coverage.html
dest
node_modules
.DS_Store
View
@@ -4,7 +4,7 @@ module.exports = function(grunt) {
jshint: {
server: [
'src/server/**/*.js',
- 'tests/server/**/*.js'
+ 'test/server/**/*.js'
],
client: [
'Gruntfile.js',
@@ -18,8 +18,17 @@ module.exports = function(grunt) {
server: {
options: {
reporter: 'spec',
+ require: 'coverage/blanket'
},
- src: ['tests/server/**/*.test.js']
+ src: ['test/server/**/*.test.js']
+ },
+ coverage: {
+ options: {
+ reporter: 'html-cov',
+ quiet: true,
+ captureFile: 'coverage.html'
+ },
+ src: '<%= mochaTest.server.src %>'
}
},
concat: {
View
@@ -0,0 +1,7 @@
+var path = require('path');
+var srcDir = path.join(__dirname, '..', 'src');
+
+require('blanket')({
+ // Only files that match the pattern will be instrumented
+ pattern: srcDir
+});
View
@@ -21,6 +21,7 @@
"socket.io": "1.2.1"
},
"devDependencies": {
+ "blanket": "^1.1.6",
"grunt": "^0.4.5",
"grunt-contrib-concat": "^0.5.0",
"grunt-contrib-copy": "^0.7.0",

0 comments on commit e66f787

Please sign in to comment.