Skip to content

Commit 4c824f5

Browse files
Exposing branch coverage data to the Istanbul report data
1 parent 657b592 commit 4c824f5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/istanbul-report/src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ class IstanbulReport extends ReportBase {
4848
filename: node.getRelativeName(),
4949
details: {
5050
lines: undefined,
51+
branchCoverage: undefined,
52+
branchMap: undefined,
5153
},
5254
};
5355

5456
const fileCoverage = node.getFileCoverage();
5557
const sourceText = context.getSource(fileCoverage.path);
5658
const lineStats = fileCoverage.getLineCoverage();
5759

60+
this.collectedData[qualifiedName].details.branchCoverage = fileCoverage.b;
61+
this.collectedData[qualifiedName].details.branchMap = fileCoverage.branchMap;
62+
5863
if (lineStats) {
5964
this.collectedData[qualifiedName].details.lines = sourceText.split(/\r?\n|\r/)
6065
.map((line, index) => {

0 commit comments

Comments
 (0)