【发布时间】:2018-02-15 17:10:26
【问题描述】:
我正在尝试将代码覆盖率报告器集成到我的业力测试中。
我在我的配置中设置了以下更改:
coverageIstanbulReporter: {
reports: ['html', 'lcovonly', 'text-summary'],
// base output directory. If you include %browser% in the path it will be replaced with the karma browser name
dir: path.join(__dirname, 'coverage'),
// if using webpack and pre-loaders, work around webpack breaking the source path
fixWebpackSourcePaths: true,
},
reporters: config.coverage ? ['kjhtml', 'dots', 'coverage-istanbul'] : ['kjhtml', 'dots'],
但不幸的是,它不会创建coverage 文件夹。
我在这里做错了什么?请注意,我正在调用karma start ./karma.conf.js --coverage,甚至在没有配置覆盖参数的情况下进行了检查。
【问题讨论】:
-
你能在 chrome 控制台上看到测试结果吗?
-
@Xlee 是的,我可以在浏览器中看到测试报告,但没有覆盖
标签: karma-jasmine istanbul karma-coverage