如何避免使用karma的captureConsole和spec报告器进行重复日志记录

时间:2017-02-19 10:25:32

标签: javascript karma-runner

我需要将日志记录和测试结果写入控制台,所以我有

client {
captureConsole: true,
}

reporters: ['spec', 'junit'],
        specReporter: {
            maxLogLines: 5,         // limit number of lines logged per test
            suppressErrorSummary: false,  // do not print error summary
            suppressFailed: false,  // do not print information about failed tests
            suppressPassed: false,  // do not print information about passed tests
            suppressSkipped: true,  // do not print information about skipped tests
            showSpecTiming: true // print the time elapsed for each spec
        },

在业力中。但这导致每个console.log被写两次,如:

  

LOG LOG:' ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'   Chrome日志:   ' ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ'

。有没有办法配置规范记者或业力,以便console.log不被公开?

UPD :似乎是一个已知问题:https://github.com/karma-runner/karma/issues/1873

0 个答案:

没有答案