(string, width, pad, truncate, coverage)
| 603 | } |
| 604 | |
| 605 | function getCell(string, width, pad, truncate, coverage) { |
| 606 | if (!table) return string; |
| 607 | |
| 608 | let result = string; |
| 609 | if (pad) result = pad(result, width); |
| 610 | if (truncate) result = truncate(result, width); |
| 611 | if (color && coverage !== undefined) { |
| 612 | if (coverage > 90) return `${coverageColors.high}${result}${color}`; |
| 613 | if (coverage > 50) return `${coverageColors.medium}${result}${color}`; |
| 614 | return `${coverageColors.low}${result}${color}`; |
| 615 | } |
| 616 | return result; |
| 617 | } |
| 618 | |
| 619 | function writeReportLine({ file, depth = 0, coveragesColumns, fileCoverage, uncoveredLines }) { |
| 620 | const fileColumn = `${prefix}${StringPrototypeRepeat(' ', depth)}${getCell(file, filePadLength - depth, StringPrototypePadEnd, truncateStart, fileCoverage)}`; |
no test coverage detected
searching dependent graphs…