* Truncate script for test name display
(script: string, maxLen = 60)
| 124 | * Truncate script for test name display |
| 125 | */ |
| 126 | function truncateScript(script: string, maxLen = 60): string { |
| 127 | // Normalize whitespace and get first meaningful line(s) |
| 128 | const normalized = script |
| 129 | .split("\n") |
| 130 | .map((l) => l.trim()) |
| 131 | .filter((l) => l && !l.startsWith("#")) |
| 132 | .join(" | "); |
| 133 | |
| 134 | if (normalized.length <= maxLen) { |
| 135 | return normalized; |
| 136 | } |
| 137 | return `${normalized.slice(0, maxLen - 3)}...`; |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Format error message for debugging |
no test coverage detected
searching dependent graphs…