Skip to content

Commit

Permalink
test: 🚨 fix coverage reports for vitest based libs and projects
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfSoko committed Nov 19, 2024
1 parent 2b514b4 commit 59fa100
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
7 changes: 6 additions & 1 deletion apps/rollapolla-analog/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
},
"test": {
"executor": "@analogjs/platform:vitest",
"outputs": ["{projectRoot}/coverage"]
"outputs": ["{workspaceRoot}/coverage/apps/{projectName}"],
"configurations": {
"ci": {
"coverage": true
}
}
},
"lint": {
"options": {
Expand Down
1 change: 1 addition & 0 deletions apps/rollapolla-analog/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
coverage: {
reportsDirectory: '../../coverage/apps/rollapolla-analog',
provider: 'v8',
reporter: ['html', 'lcov', 'text'],
},
},
define: {
Expand Down
9 changes: 7 additions & 2 deletions libs/public/spa-cdk-stack/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"outputs": ["{workspaceRoot}/coverage/libs/public/spa-cdk-stack"],
"options": {
"reportsDirectory": "../../../coverage/libs/public/spa-cdk-stack"
"reportsDirectory": "{workspaceRoot}/coverage/libs/public/spa-cdk-stack"
},
"configurations": {
"ci": {
"coverage": true
}
}
}
},
Expand Down
1 change: 1 addition & 0 deletions libs/public/spa-cdk-stack/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default defineConfig({
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
reporter: ['lcov', 'html', 'text-summary'],
reportsDirectory: '../../../coverage/libs/public/spa-cdk-stack',
provider: 'v8',
},
Expand Down
9 changes: 7 additions & 2 deletions libs/shared/data-access/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@
},
"test": {
"executor": "@nx/vite:test",
"outputs": ["{options.reportsDirectory}"],
"outputs": ["{workspaceRoot}/coverage/libs/shared/data-access"],
"options": {
"reportsDirectory": "../../../coverage/libs/shared/data-access"
"reportsDirectory": "{workspaceRoot}/coverage/libs/shared/data-access"
},
"configurations": {
"ci": {
"coverage": true
}
}
},
"lint": {
Expand Down
1 change: 1 addition & 0 deletions libs/shared/data-access/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig({
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: ['default'],
coverage: {
reporter: ['lcov', 'html', 'text-summary'],
reportsDirectory: '../../../coverage/libs/shared/data-access',
provider: 'v8',
},
Expand Down

0 comments on commit 59fa100

Please sign in to comment.