我尝试nyc
按照coveralls
说明进行操作:
https ://github.com/istanbuljs/nyc#integrating-with-coveralls
但我无法让它工作。这是一个示例仓库: https ://github.com/unional/showdown-highlightjs-extension
Travis 构建成功:https ://travis-ci.org/unional/showdown-highlightjs-extension
并且工作服注意到构建,但似乎没有得到任何数据: https ://coveralls.io/github/unional/showdown-highlightjs-extension
这是我的.travis.yml
:
language: node_js
notifications:
email:
on_success: never
on_failure: change
node_js:
- "stable"
before_install:
- npm install -g npm
script:
- npm run verify
after_script:
- npm install coveralls && npm run coveralls
这是我的package.json
:
{
...
"scripts": {
"coverage": "npm test && nyc check-coverage --branches 85 --functions 85 --lines 85",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"test": "npm run clean && tsc && nyc ava"
...
},
"nyc": {
"exclude": [
"scripts",
"**/*.spec.*",
"**/fixtures/**/*"
]
},
...
}