如何设置多种类型的 Karma 覆盖报告?

问题描述 投票:0回答:2

我想从 karma 覆盖率报告器获取 cobertura 和 html 输出。目前我必须运行测试两次。一次使用此配置:

reporters: ['progress', 'coverage']
coverageReporter: { type : 'cobertura', dir : 'coverage/', file: 'cobertura.xml' }

另一次:

coverageReporter: {type : 'html'....

有没有办法一次性做到这一点?

karma-runner karma-jasmine
2个回答
14
投票
coverageReporter: {
  reporters: [
    { type: 'html', dir: '/' },
    { type: 'cobertura', dir: '...' }
  ]
}

应该可以工作


1
投票
coverageReporter: {
  dir: 'coverage-report',
  reporters: [{
    type: 'html',
    subdir: 'report-html',
  }, {
    type: 'lcov',
    subdir: 'report-lcov',
  }]
}
© www.soinside.com 2019 - 2024. All rights reserved.