MCPcopy Index your code
hub / github.com/nodejs/node / getCell

Function getCell

lib/internal/test_runner/utils.js:605–617  ·  view source on GitHub ↗
(string, width, pad, truncate, coverage)

Source from the content-addressed store, hash-verified

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)}`;

Callers 1

writeReportLineFunction · 0.85

Calls 2

padFunction · 0.50
truncateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…