istanbul-reports
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -6,2 +6,13 @@ # Change Log | ||
## [3.0.2](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.1...istanbul-reports@3.0.2) (2020-04-01) | ||
### Bug Fixes | ||
* Ignore insignificant lines when coalesce ([#525](https://github.com/istanbuljs/istanbuljs/issues/525)) ([d7d7cfa](https://github.com/istanbuljs/istanbuljs/commit/d7d7cfa1301f0dde2ff19078c31235ffd55c01ef)) | ||
## [3.0.1](https://github.com/istanbuljs/istanbuljs/compare/istanbul-reports@3.0.0...istanbul-reports@3.0.1) (2020-03-26) | ||
@@ -8,0 +19,0 @@ |
@@ -70,3 +70,3 @@ /* | ||
let missingLines; | ||
let coveredLines; | ||
@@ -76,15 +76,21 @@ const fileCoverage = node.getFileCoverage(); | ||
const branches = fileCoverage.getBranchCoverageByLine(); | ||
missingLines = Object.keys(branches).filter( | ||
key => branches[key].coverage < 100 | ||
); | ||
coveredLines = Object.entries(branches).map(([key, { coverage }]) => [ | ||
key, | ||
coverage === 100 | ||
]); | ||
} else { | ||
missingLines = fileCoverage.getUncoveredLines(); | ||
coveredLines = Object.entries(fileCoverage.getLineCoverage()); | ||
} | ||
const ranges = missingLines | ||
.reduce((acum, line) => { | ||
line = parseInt(line); | ||
const range = acum[acum.length - 1]; | ||
if (range && range[range.length - 1] === line - 1) range.push(line); | ||
else acum.push([line]); | ||
let newRange = true; | ||
const ranges = coveredLines | ||
.reduce((acum, [line, hit]) => { | ||
if (hit) newRange = true; | ||
else { | ||
line = parseInt(line); | ||
if (newRange) { | ||
acum.push([line]); | ||
newRange = false; | ||
} else acum[acum.length - 1][1] = line; | ||
} | ||
@@ -96,5 +102,5 @@ return acum; | ||
if (length <= 2) return range; | ||
if (length === 1) return range[0]; | ||
return `${range[0]}-${range[length - 1]}`; | ||
return `${range[0]}-${range[1]}`; | ||
}); | ||
@@ -101,0 +107,0 @@ |
{ | ||
"name": "istanbul-reports", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "istanbul reports", | ||
@@ -60,3 +60,3 @@ "author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>", | ||
}, | ||
"gitHead": "df24342395030dc2a40a7ceb0476a9897f3492a3" | ||
"gitHead": "73c25ce79f91010d1ff073aa6ff3fd01114f90db" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
284875
3790