当我试图在.istanbul.YML
中设置阈值时,我正在使用伊斯坦布尔记者进行代码覆盖
check:
global:
statements: 60
lines: 100
branches: 50
functions: 60
excludes: []
each:
statements: 100
lines: 100
branches: 100
functions: 100
excludes: []
覆盖文件时,如果它不符合阈值,但运行伊斯坦布尔覆盖和伊斯坦布尔检查覆盖的覆盖百分比不同,所以计划使用nyc我将其配置为
.nycrc
{
"lines": 50,
"statements": 50,
"functions": 50,
"branches": 50,
"reporter": [
"lcov",
"text-summary"
],
"extension": [
".jsx"
],
"check-coverage": true
}
我可以在全局设置覆盖阈值,但是如何在每个文件的基础上设置阈值或在istanbul中正确获取覆盖率百分比。
你应该用
“per-file”:是的