覆盖范围合并
用于合并解析覆盖报告的Node.js库.
这个库可以合并解析的覆盖结果. 支持以下解析器:
示例
const coverageMerger = require('@connectis/coverage-merger');
const mergedResults = coverageMerger.mergeByFile(coverageResults);
API 密码
API包括以下内容:
- 合并ByFile( 覆盖结果)
- 合并By( 覆盖结果, 组器)
- 合并( 覆盖结果)
合并ByFile( 覆盖结果)
合并覆盖结果,其价值与 file 属性.
覆盖面
类型 : Array<CoverageResult. 见下文.
返回时
类型 : Array<CoverageResult. 见下文.
合并By( 覆盖结果, 组器)
合并覆盖结果 grouper 命令返回相同的字符串 . groupBy 组合。 。 。 .
覆盖面
类型 : Array<CoverageResult. 见下文.
组合器
类型 : (CoverageResult) => String. 见下文.
返回时
类型 : Array<CoverageResult. 见下文.
合并( 覆盖结果)
将一系列覆盖结果合并为一个结果.
覆盖面
类型 : Array<CoverageResult. 见下文.
返回时
类型 : CoverageResult. 见下文.
覆盖范围
返回的数据格式如下.
{
"title": "Test #1",
"file": "/some/absolute/path/anim-base/anim-base-coverage.js",
"functions": {
"hit": 23,
"found": 29,
"details": [
{
"name": "(anonymous 1)",
"line": 7,
"hit": 6
},
{
"name": "(anonymous 2)",
"line": 620,
"hit": 225
},
{
"name": "_end",
"line": 516,
"hit": 228
}
]
},
"lines": {
"found": 181,
"hit": 143,
"details": [
{
"line": 7,
"hit": 6
},
{
"line": 29,
"hit": 6
},
{
"line": 41,
"hit": 0
}
]
},
"branches": {
"found": 2,
"hit": 1,
"details": [
{
"line": 9,
"branch": 0,
"taken": 0
},
{
"line": 9,
"branch": 1,
"taken": 1
}
]
}
}