Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
feat(test): support generating coverage report with istanbul
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Dec 12, 2015
1 parent 8d4f1d0 commit 6af23c9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ module.exports = function (grunt) {
default: {
src: ['<%- sourceRoot %>/**/*.ts']
}
},
remapIstanbul: {
build: {
src: '.coverage/**/coverage-final.json',
options: {
reports: {
'html': 'coverage',
'lcovonly': '.coverage/lcov.info'
}
}
}
}

});
Expand All @@ -92,6 +103,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-ts');
grunt.loadNpmTasks('dts-generator');
grunt.loadNpmTasks('remap-istanbul');
grunt.registerTask('default', ['copy', 'dtsGenerator', 'ts', 'sass']);
grunt.registerTask('develop', ['default', 'watch']);
grunt.registerTask('build', ['default', 'dist-bundle']);
Expand Down
24 changes: 12 additions & 12 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module.exports = function (config) {
"use strict";

var coverageDebug = true;
var coverageDebug = false;

config.set({
basePath: '',
Expand Down Expand Up @@ -43,17 +43,17 @@ module.exports = function (config) {
base: 'Chrome',
flags: ['--no-sandbox']
}
},

preprocessors: (process.env.TRAVIS || coverageDebug) ? {"ng2-material/**/*.js": "coverage"} : {},
coverageReporter: {
dir: '.coverage',

reporters: [
// reporters not supporting the `file` property
{type: 'json'},
{type: 'lcov'}
]
}
//
//preprocessors: (process.env.TRAVIS || coverageDebug) ? {"lib/ng2-material/*.js": "coverage"} : {},
//coverageReporter: {
// dir: '.coverage',
//
// reporters: [
// // reporters not supporting the `file` property
// {type: 'json'},
// {type: 'lcov'}
// ]
//}
});
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"typings": "lib/ng2-material/ng2-material.d.ts",
"devDependencies": {
"dts-generator": "^1.6.3",
"istanbul": "^1.0.0-alpha.2",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.7.0",
Expand All @@ -36,7 +37,9 @@
"grunt-ts": "^5.2.0",
"karma": "^0.13.15",
"karma-chrome-launcher": "^0.2.2",
"karma-coverage": "0.5.3",
"karma-jasmine": "^0.2.2",
"remap-istanbul": "^0.4.0",
"systemjs-builder": "justindujardin/builder.git#typescript-source-maps"
}
}

0 comments on commit 6af23c9

Please sign in to comment.