(filePath)
| 33 | } |
| 34 | |
| 35 | async function parseLcov(filePath) { |
| 36 | const text = await readText(filePath); |
| 37 | let found = 0; |
| 38 | let hit = 0; |
| 39 | for (const line of text.split("\n")) { |
| 40 | if (line.startsWith("LF:")) { |
| 41 | found += Number(line.slice(3)); |
| 42 | } else if (line.startsWith("LH:")) { |
| 43 | hit += Number(line.slice(3)); |
| 44 | } |
| 45 | } |
| 46 | return found > 0 ? Number(((hit / found) * 100).toFixed(2)) : null; |
| 47 | } |
| 48 | |
| 49 | async function parseCoverageXml(filePath) { |
| 50 | const text = await readText(filePath); |
no test coverage detected