Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit f2c81ab

Browse files
committed
Enable coverage and coverage reporting
1 parent dc78347 commit f2c81ab

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ on: push
55
jobs:
66
build:
77
name: Test
8-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
# Required to checkout the code
12+
contents: read
13+
# Required to put a comment into the pull-request
14+
pull-requests: write
915

1016
steps:
1117
- name: Checkout repo
@@ -21,3 +27,8 @@ jobs:
2127

2228
- run: npm run typecheck
2329
- run: npm run test
30+
- name: 'Report Coverage'
31+
# Set if: always() to also generate the report if tests are failing
32+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
33+
if: always()
34+
uses: davelosert/vitest-coverage-report-action@v2

vite.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
outDir: "build",
55
test: {
66
coverage: {
7+
enabled: true,
78
include: ["src/**"],
89
exclude: ["demo/**", "scripts/**"],
910
},

0 commit comments

Comments
 (0)