(summary)
| 530 | const kSeparator = ' | '; |
| 531 | |
| 532 | function buildFileTree(summary) { |
| 533 | const tree = { __proto__: null }; |
| 534 | let treeDepth = 1; |
| 535 | let longestFile = 0; |
| 536 | |
| 537 | ArrayPrototypeForEach(summary.files, (file) => { |
| 538 | let longestPart = 0; |
| 539 | const parts = StringPrototypeSplit(relative(summary.workingDirectory, file.path), sep); |
| 540 | let current = tree; |
| 541 | |
| 542 | ArrayPrototypeForEach(parts, (part, index) => { |
| 543 | current[part] ||= { __proto__: null }; |
| 544 | current = current[part]; |
| 545 | // If this is the last part, add the file to the tree |
| 546 | if (index === parts.length - 1) { |
| 547 | current.file = file; |
| 548 | } |
| 549 | // Keep track of the longest part for padding |
| 550 | longestPart = MathMax(longestPart, part.length); |
| 551 | }); |
| 552 | |
| 553 | treeDepth = MathMax(treeDepth, parts.length); |
| 554 | longestFile = MathMax(longestPart, longestFile); |
| 555 | }); |
| 556 | |
| 557 | return { __proto__: null, tree, treeDepth, longestFile }; |
| 558 | } |
| 559 | |
| 560 | function getCoverageReport(pad, summary, symbol, color, table) { |
| 561 | const prefix = `${pad}${symbol}`; |
no test coverage detected
searching dependent graphs…