2017-09-07 171 views
0

我正在尝试将代码覆盖率记者集成到我的业力测试中。噶玛覆盖伊斯坦布尔不会创建文件夹

我成立了我的配置如下更改:

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'], 

但unfortnetly,它不会创建一个coverage文件夹。

这里是我的full karma.config.js

我在做什么错在这里?请注意,我打电话给karma start ./karma.conf.js --coverage,甚至在没有配置覆盖参数的情况下检查。

+0

你可以看到镀铬控制台测试结果? – Xlee

+0

@Xlee是的,我可以在浏览器中看到测试报告,但没有覆盖 – Amit

回答

1

给你,让Chrome控制台text-summary输出,并且已经有指定的基地目录的记者,你只需要明确地告诉记者,其子目录应使用不同的报告类型:

尝试添加coverageIstanbulReporter按本条(从回购的自述):

// Most reporters accept additional config options. You can pass these through the `report-config` option 
    'report-config': { 

    // all options available at: https://github.com/istanbuljs/istanbul-reports/blob/590e6b0089f67b723a1fdf57bc7ccc080ff189d7/lib/html/index.js#L135-L137 
    html: { 
     // outputs the report in ./coverage/html 
     subdir: 'html' 
    } 

    } 
+0

添加,仍然是相同的 - 不创建'coverage/html' – Amit

+0

项目根目录没有'coverage /'文件夹? – Xlee

+0

没有。我试图手动创建它并再次运行,但没有'html'文件夹。 – Amit

相关问题