【问题标题】:How do i set threshold per each file using nyc Istanbul CLI reporter?如何使用 nyc Istanbul CLI 报告器为每个文件设置阈值?
【发布时间】: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


    【解决方案1】:

    你应该使用

    “每个文件”:真

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-09
      • 1970-01-01
      • 2018-09-13
      • 1970-01-01
      • 2016-09-06
      • 1970-01-01
      相关资源
      最近更新 更多