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

Function addLcovToJest

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

Source from the content-addressed store, hash-verified

44}
45
46function addLcovToJest(content: string): string {
47 try {
48 const mod = parseModule(content);
49 const config = getDefaultExportOptions(mod);
50 const reporters = config['coverageReporters'];
51 if (!reporters?.['length']) {
52 return content;
53 }
54 deepMergeObject(
55 config,
56 buildNestedObject(['coverageReporters'], [...reporters, 'lcov']),
57 );
58 return generateCode(mod).code;
59 } catch {
60 return content;
61 }
62}
63
64export function buildNestedObject(
65 segments: string[],

Callers 1

addLcovReporterFunction · 0.85

Calls 1

buildNestedObjectFunction · 0.85

Tested by

no test coverage detected