(content: string)
| 28 | } |
| 29 | |
| 30 | function addLcovToVitest(content: string): string { |
| 31 | try { |
| 32 | const mod = parseModule(content); |
| 33 | const config = getDefaultExportOptions(mod); |
| 34 | const reporter = config['test']?.['coverage']?.['reporter']; |
| 35 | const base = reporter?.['length'] ? [...reporter] : VITEST_DEFAULTS; |
| 36 | deepMergeObject( |
| 37 | config, |
| 38 | buildNestedObject(['test', 'coverage', 'reporter'], [...base, 'lcov']), |
| 39 | ); |
| 40 | return generateCode(mod).code; |
| 41 | } catch { |
| 42 | return content; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | function addLcovToJest(content: string): string { |
| 47 | try { |
no test coverage detected