(content: string, framework: string)
| 4 | const VITEST_DEFAULTS = ['text', 'html', 'clover', 'json']; |
| 5 | |
| 6 | export function hasLcovReporter(content: string, framework: string): boolean { |
| 7 | switch (framework) { |
| 8 | case 'vitest': |
| 9 | return /['"]lcov['"]/.test(content) && content.includes('reporter'); |
| 10 | case 'jest': |
| 11 | return ( |
| 12 | !content.includes('coverageReporters') || /['"]lcov['"]/.test(content) |
| 13 | ); |
| 14 | default: |
| 15 | return false; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | export function addLcovReporter(content: string, framework: string): string { |
| 20 | switch (framework) { |
no outgoing calls
no test coverage detected