2014-04-22 120 views
2

我正在尝试使用istanbul instrument输出到mocha -R html-cov,但无法使其工作。我可以使用伊斯坦布尔为摩卡工具html-cov

我的测试脚本是:

test: 
    post: 
    - node_modules/.bin/istanbul cover node_modules/.bin/_mocha -dir $CIRCLE_ARTIFACTS -- -u exports -R spec 
    - node_modules/.bin/istanbul instrument . -o lib-cov 
    - cp package.json lib-cov/ # needs to be copied manually 
    - MY_LIB_COV=1 node_modules/.bin/mocha -R html-cov > $CIRCLE_ARTIFACTS/coverage.html 

我的测试有以下开关:

var mylib = process.env.MY_LIB_COV ? require('../lib-cov') : require('../'); 

伊斯坦布尔是给我在lcov-report/index.html良好的输出。
摩卡的HTML-COV是给我 '0%的覆盖率0 SLOC' 在coverage.html

伊斯坦布尔的lcov报告是丑陋的。我想用漂亮的mocha -R html-cov报告。

我发现的所有例子都使用jscoverage。我必须使用jscoverage吗?我错过了一招吗?

回答

相关问题