Skip to content

Commit

Permalink
Use karma-coverage
Browse files Browse the repository at this point in the history
Closes #158.
  • Loading branch information
niksy committed Jan 27, 2020
1 parent a180e85 commit b5f8ba3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"nyc": "^12.0.2"<% } %><% if ( automatedTests && codeCoverage && browserModule && !sassModule ) { %><% if ( bundlingTool === 'webpack' ) { %>,
"istanbul-instrumenter-loader": "^3.0.1"<% } %><% if ( bundlingTool === 'rollup' ) { %>,
"rollup-plugin-istanbul": "^2.0.1"<% } %>,
"karma-coverage-istanbul-reporter": "^2.0.1"<% } %><% if ( codeCoverageService ) { %>,
"karma-coverage": "^2.0.1"<% } %><% if ( codeCoverageService ) { %>,
"coveralls": "^2.11.11"<% } %><% if ( manualTests || integrationTests ) { %>,
"del": "^2.2.0",
"globby": "^4.1.0",<% if ( bundlingTool === 'webpack' ) { %>
Expand Down
11 changes: 5 additions & 6 deletions generators/app/templates/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = function ( baseConfig ) {
'test/<% if ( manualTests || integrationTests ) { %>automated/<% } %>**/.webpack.js': ['webpack', 'sourcemap']<% } %><% if ( bundlingTool === 'rollup' ) { %>
'test/<% if ( manualTests || integrationTests ) { %>automated/<% } %><% if ( vanillaJsWidget ) { %>index<% } else { %>**/*<% } %>.js': ['rollup', 'sourcemap']<% } %>
},
reporters: ['mocha'<% if ( codeCoverage ) { %>, 'coverage-istanbul'<% } %>],
reporters: ['mocha'<% if ( codeCoverage ) { %>, 'coverage'<% } %>],
port: port,
colors: true,
logLevel: baseConfig.LOG_INFO,
Expand Down Expand Up @@ -166,11 +166,10 @@ module.exports = function ( baseConfig ) {
intro: 'window.TYPED_ARRAY_SUPPORT = false;' // IE9
}
}<% } %>,<% if ( codeCoverage ) { %>
coverageIstanbulReporter: {
dir: path.join(__dirname, 'coverage/%browser%'),
fixWebpackSourcePaths: true,
reports: ['html', 'text'],
thresholds: {
coverageReporter: {
dir: path.join(__dirname, 'coverage'),
reporters: [{type: 'html'}, {type: 'text'}],
check: {
global: {
statements: 80
}
Expand Down

0 comments on commit b5f8ba3

Please sign in to comment.