MCPcopy Index your code
hub / github.com/code-pushup/cli / configureCoveragePlugin

Function configureCoveragePlugin

code-pushup.preset.ts:82–118  ·  view source on GitHub ↗
(
  projectName?: string,
)

Source from the content-addressed store, hash-verified

80}
81
82export async function configureCoveragePlugin(
83 projectName?: string,
84): Promise<CoreConfig> {
85 const targets = ['unit-test', 'int-test'];
86 const config: CoveragePluginConfig = projectName
87 ? // We do not need to run a coverageToolCommand. This is handled over the Nx task graph.
88 {
89 reports: Object.keys(
90 (await createProjectGraphAsync()).nodes[projectName]?.data.targets ??
91 {},
92 )
93 .filter(target => targets.includes(target))
94 .map(target => ({
95 pathToProject: `packages/${projectName}`,
96 resultsPath: `coverage/${projectName}/${target}s/lcov.info`,
97 })),
98 }
99 : {
100 reports: await getNxCoveragePaths(targets),
101 coverageToolCommand: {
102 command: `npx nx run-many -t ${targets.join(',')}`,
103 },
104 };
105 return {
106 plugins: [await coveragePlugin(config)],
107 categories: [
108 {
109 slug: 'code-coverage',
110 title: 'Code coverage',
111 description: 'Measures how much of your code is **covered by tests**.',
112 refs: [
113 { type: 'group', plugin: 'coverage', slug: 'coverage', weight: 1 },
114 ],
115 },
116 ],
117 };
118}
119
120export async function configureJsPackagesPlugin(): Promise<CoreConfig> {
121 return {

Calls 2

getNxCoveragePathsFunction · 0.85
coveragePluginFunction · 0.85

Tested by

no test coverage detected