Skip to content

Commit

Permalink
setup code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Nov 11, 2024
1 parent c957a0a commit 0ed0942
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
5 changes: 3 additions & 2 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import nxPerformancePlugin, {
} from './tooling/measures/nx-performance/nx-performance.plugin';
import { TaskTimeAuditOption } from './tooling/measures/nx-performance';
import { mergeConfigs } from '@code-pushup/utils';
import { eslintCoreConfigNx, jsPackagesCoreConfig } from './code-pushup.preset';
import {coverageCoreConfigNx, eslintCoreConfigNx, jsPackagesCoreConfig} from './code-pushup.preset';

const onlyAudits: OnlyAudit[] = [
'graph-time-project',
Expand Down Expand Up @@ -59,5 +59,6 @@ export default mergeConfigs(
],
},
await jsPackagesCoreConfig(),
await eslintCoreConfigNx()
await eslintCoreConfigNx(),
await coverageCoreConfigNx(['nx-verdaccio'])
);
12 changes: 7 additions & 5 deletions code-pushup.preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ export const coverageCoreConfigNx = async (
args: [
'nx',
projectName
? `run --projects ${projectName.join(' ')}`
: 'run-many',
...targetArgs,
'--exclude=tags:type:example',
? `run-many --projects ${projectName.join(' ')}`
: 'run',
...targetArgs
],
},
reports: await getNxCoveragePaths(targetNames),
reports: [
'coverage/projects/unit/nx-verdaccio/lcov.info',
'coverage/projects/integration/nx-verdaccio/lcov.info',
],
}),
],
categories: coverageCategories,
Expand Down
4 changes: 2 additions & 2 deletions projects/nx-verdaccio/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';

export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/projects/build-env',
cacheDir: '../../node_modules/.vite/projects/nx-verdaccio',

plugins: [nxViteTsPaths()],

Expand All @@ -26,7 +26,7 @@ export default defineConfig({
],
coverage: {
reporter: ['lcov', 'text-summary'],
reportsDirectory: '../../coverage/projects/build-env',
reportsDirectory: '../../coverage/projects/unit/nx-verdaccio',
provider: 'v8',
},
},
Expand Down

0 comments on commit 0ed0942

Please sign in to comment.