MCPcopy Create free account
hub / github.com/code-pushup/cli / addLcovToVitest

Function addLcovToVitest

packages/plugin-coverage/src/lib/config-file.ts:30–44  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

28}
29
30function 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
46function addLcovToJest(content: string): string {
47 try {

Callers 1

addLcovReporterFunction · 0.85

Calls 1

buildNestedObjectFunction · 0.85

Tested by

no test coverage detected