Tod*_*rst 6 code-coverage qunit istanbul coveralls
我在让工作服上班时遇到问题.我在这里创建了一个简单的项目.
它似乎正在正确地输出报告,但我肯定错过了某个地方,因为工作服不会看到我的设置.没有分支显示,它只是给出了如何设置它的说明.我试图复制qunit正在做什么,因为他们显然有它的工作.
这是我到目前为止所做的.
创建了使用node/grunt/qunit以及工作服帐户并在项目上切换的项目.我已经用这个替换了部分中的qunit引用.devDependenciespackage.json
"grunt-coveralls": "0.3.0",
"grunt-qunit-istanbul": "^0.4.0"
Run Code Online (Sandbox Code Playgroud)
我已将此添加到我的package.json.
"scripts": {
"ci": "grunt && grunt coveralls"
}
Run Code Online (Sandbox Code Playgroud)
我已经添加了这个配置对于qunit我的Gruntfile.js.
options: {
timeout: 30000,
"--web-security": "no",
coverage: {
src: [ "src/<%= pkg.name %>.js" ],
instrumentedFiles: "temp/",
coberturaReport: "report/",
htmlReport: "build/report/coverage",
lcovReport: "build/report/lcov",
linesThresholdPct: 70
}
},
Run Code Online (Sandbox Code Playgroud)
然后我把它添加到我的.travis.yml.
language: node_js
node_js:
- "0.10"
before_install:
npm install -g grunt-cli
install:
npm install
before_script:
grunt
after_script:
npm run-script coveralls
Run Code Online (Sandbox Code Playgroud)
我让它工作了,检查示例的存储库https://github.com/thorst/Code-Coverage-Qunit
虽然这并不总是可能的,但我发现茉莉花在很多方面都更容易。我这里有一个完整的示例:https ://github.com/thorst/Code-Coverage-Jasmine
不过,我还没有让摩卡发挥作用。该(损坏的)存储库在这里:https ://github.com/thorst/Code-Coverage-Mocha
| 归档时间: |
|
| 查看次数: |
1654 次 |
| 最近记录: |