Add Coverage report for Unit and Integration tests
issue #361 - Added shell:coverage task to generate coverage report - Registered test-coverage Grunt task as shortcut of shell:coverage - Added coverage files to .gitignore - Added require-cli and blanket to package.json
This commit is contained in:
parent
ab639f7026
commit
afbbee031e
5
.gitignore
vendored
5
.gitignore
vendored
@ -57,4 +57,7 @@ CHANGELOG.md
|
||||
config.js
|
||||
|
||||
# Built asset files
|
||||
/core/built
|
||||
/core/built
|
||||
|
||||
# Coverage reports
|
||||
coverage.html
|
@ -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']);
|
||||
|
8
core/test/blanket_coverage.js
Normal file
8
core/test/blanket_coverage.js
Normal 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");
|
@ -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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user