2014-02-21 66 views
0

如何为Karma配置文件中存在的所有浏览器创建代码覆盖率报告? 我config.js看起来像Karma中多个浏览器的代码覆盖率报告

module.exports = function (config) { 
    config.set({ 
    frameworks: ['jasmine'], 
    files: [...], 
    browsers: ['IE', 'Firefox', 'Chrome'], 
    reporters: ['progress', 'coverage'], 
    preprocessors: { '*.js': ['coverage'] }, 
    coverageReporter: { 
     type : 'html', 
     dir : ..., 
    }, 
    singleRun: true 
    . . . . 
}); 
}; 

通过了所有测试正常,但仅适用于最后结束的浏览器生成报告。顺便说一句,Json格式的报告通常为所有浏览器生成。

npm of version 1.4.3 

node.js of version 0.10.26 
安装Win8的64

P.S.在Win7 x64上它似乎工作:生成所有报告。

回答

0

它也发生在我身上。 添加一个配置将产生对于所有浏览器的覆盖率报告:

singleRun: true 

当然,缺点是测试将只跑了一次(后,该脚本将退出)。

+0

对不起,代码中不包括该行,但'singleRun'设置为'true'。我添加了一些总是出现在我的'conf.js'中的行。 – Andrew

相关问题