【问题标题】:How to setup Karma coverage reporter with multiple types?如何设置多种类型的 Karma 报道记者?
【发布时间】:2014-09-25 12:00:57
【问题描述】:

我想从业力报道记者那里获得 cobertura 和 html 输出。目前我必须运行两次测试。一次使用此配置:

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

另一次:

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

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

【问题讨论】:

    标签: karma-runner karma-jasmine


    【解决方案1】:
    coverageReporter: {
      reporters: [
        { type: 'html', dir: '/' },
        { type: 'cobertura', dir: '...' }
      ]
    }
    

    应该有效

    【讨论】:

      【解决方案2】:
       coverageReporter: {
        dir: 'coverage-report',
        reporters: [{
          type: 'html',
          subdir: 'report-html',
        }, {
          type: 'lcov',
          subdir: 'report-lcov',
        }]
      }
      

      【讨论】:

      • 虽然此代码可能会回答问题,但提供有关此代码为何和/或如何回答问题的额外上下文可提高其长期价值。
      猜你喜欢
      • 1970-01-01
      • 2018-11-24
      • 1970-01-01
      • 2014-04-21
      • 1970-01-01
      • 1970-01-01
      • 2012-10-10
      • 2014-09-04
      • 1970-01-01
      相关资源
      最近更新 更多