【发布时间】:2017-07-02 11:57:54
【问题描述】:
当我尝试在.istanbul.YML 中设置阈值时,我正在使用伊斯坦布尔记者进行代码覆盖
check:
global:
statements: 60
lines: 100
branches: 50
functions: 60
excludes: []
each:
statements: 100
lines: 100
branches: 100
functions: 100
excludes: []
不满足阈值但运行 istanbul 覆盖率和 istanbul check-coverage 覆盖率不同的覆盖率文件,因此计划使用 nyc 我将其配置为
.nycrc
{
"lines": 50,
"statements": 50,
"functions": 50,
"branches": 50,
"reporter": [
"lcov",
"text-summary"
],
"extension": [
".jsx"
],
"check-coverage": true
}
我可以在全局范围内设置覆盖率阈值,但是如何根据文件设置阈值或在伊斯坦布尔正确获取覆盖率。
【问题讨论】:
标签: unit-testing testing code-coverage istanbul