2017-09-07 65 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

相關問題