Merge pull request #1429 from germanrcuriel/add-coverage-report-with-blanket

Add Coverage report for Unit and Integration tests
This commit is contained in:
Hannah Wolfe 2013-11-11 12:50:49 -08:00
commit 61d693cac9
4 changed files with 22 additions and 1 deletions

5
.gitignore vendored
View File

@ -57,4 +57,7 @@ CHANGELOG.md
config.js
# Built asset files
/core/built
/core/built
# Coverage reports
coverage.html

View File

@ -258,6 +258,9 @@ var path = require('path'),
shell: {
bourbon: {
command: 'bourbon install --path <%= paths.adminAssets %>/sass/modules/'
},
coverage: {
command: './node_modules/mocha/bin/mocha --timeout 15000 --reporter html-cov > coverage.html ./core/test/blanket_coverage.js'
}
},
@ -873,6 +876,11 @@ var path = require('path'),
grunt.registerTask('validate', 'Run tests and lint code', ['jslint', 'test-unit', 'test-integration', 'test-functional']);
// ## Coverage report for Unit and Integration Tests
grunt.registerTask('test-coverage', 'Generate unit and integration tests coverage report', ['clean:test', 'setTestEnv', 'loadConfig', 'express:test', 'shell:coverage']);
// ## Documentation
grunt.registerTask('docs', 'Generate Docs', ['groc']);

View File

@ -0,0 +1,8 @@
var blanket = require("blanket")({
"pattern": ["/core/server/", "/core/client/", "/core/shared/"],
"data-cover-only": ["/core/server/", "/core/client/", "/core/shared/"]
}),
requireDir = require("require-dir");
requireDir("./unit");
requireDir("./integration");

View File

@ -55,6 +55,7 @@
"mysql": "2.0.0-alpha9"
},
"devDependencies": {
"blanket": "~1.1.5",
"grunt": "~0.4.1",
"grunt-bump": "~0.0.11",
"grunt-contrib-clean": "~0.5.0",
@ -74,6 +75,7 @@
"matchdep": "~0.3.0",
"mocha": "~1.13.0",
"request": "~2.27.0",
"require-dir": "~0.1.0",
"should": "~2.0.2",
"sinon": "~1.7.3"
}