简体   繁体   English

业力报告浏览器子文件夹

[英]Karma report browser subfolders

I am using karma to run my javascript tests, and to generate a coverage report. 我正在使用业力运行我的JavaScript测试并生成覆盖率报告。 Here is my coverage configuration from the karma.conf.js: 这是来自karma.conf.js的覆盖配置:

coverageReporter: {
      dir : 'coverage/',
      reporters: [
        { type: 'text-summary' },
        { type: 'html' },
        { type: 'lcov' }
      ]
}

What I do not like about the set-up is that I always get a subfolder named after the browser used to run the tests. 我对设置不满意的是,我总是得到一个以运行测试的浏览器命名的子文件夹。 In my case, I use only PhantomJS, and would prefer to have the reports directly under /coverage . 就我而言,我仅使用PhantomJS,并且希望将报告直接放在/coverage Is there a way to do this? 有没有办法做到这一点?

Seems subdir is determined from dir, not from dir/. 似乎subdir是从dir而不是dir /确定的。 So this works fine: 所以这很好用:

coverageReporter: {
      dir : 'coverage/',
      reporters: [
        { type: 'text-summary' },
        { type: 'html', subdir: '.' },
        { type: 'lcov', subdir: '.' }
      ]
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM