我很难穿上工作服去上班。我创建了一个简单的项目这里。
这似乎是正确的输出报告,但我肯定错过了一个步骤,因为工作服不认为我是被设置的。没有分支出现,它只是给出了如何设置它的说明。我试着复制qunit正在做的事情,因为他们显然让它起作用了。
这是我到目前为止所做的。
创建使用节点/grunt/qunit以及工作服帐户的项目,并在项目上切换。然后,我将qunit引用替换为package.json中的devDependencies部分中的引用。
"grunt-coveralls": "0.3.0",
"grunt-qunit-istanbul": "^0.4.0"我已经把这个添加到我的package.json中了。
"scripts": {
"ci": "grunt && grunt coveralls"
}我已经在我的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
}
},然后,我将其添加到我的.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发布于 2014-03-20 00:49:38
我让它正常工作,请查看回购程序中的示例https://github.com/thorst/Code-Coverage-Qunit
虽然这并不总是可能的,但我发现茉莉花在多种方面更容易。这里有一个完整的例子:https://github.com/thorst/Code-Coverage-Jasmine
不过,我还是没让摩卡上班。(坏的)回购在这里:https://github.com/thorst/Code-Coverage-Mocha
https://stackoverflow.com/questions/22490150
复制相似问题