Skip to content

Commit

Permalink
feat: update karma config
Browse files Browse the repository at this point in the history
  • Loading branch information
sinedied committed Dec 10, 2021
1 parent bde28f6 commit 90d40e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions generators/app/templates/__tools-karma._karma.conf.js
Expand Up @@ -14,10 +14,16 @@ module.exports = function(config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-junit-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false, // leave Jasmine Spec Runner output visible in browser
captureConsole: Boolean(process.env.KARMA_ENABLE_CONSOLE)
},
Expand All @@ -27,10 +33,13 @@ module.exports = function(config) {
useBrowserName: false,
suite: '' // Will become the package name attribute in xml testsuite element
},
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
dir: path.join(__dirname, './reports/coverage'),
fixWebpackSourcePaths: true
coverageReporter: {
dir: require('path').join(__dirname, './coverage/ng13'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'junit'],
port: 9876,
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/_package.json
Expand Up @@ -197,7 +197,7 @@
<% } else { -%>
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "~1.7.0",
"karma-junit-reporter": "^2.0.1",
Expand Down

0 comments on commit 90d40e6

Please sign in to comment.