Skip to content

Commit 2a7be74

Browse files
authored
Add unit test coverage reporting (#578)
1 parent c8f6026 commit 2a7be74

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.github/actions/test/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ runs:
77
- name: Run tests
88
run: pnpm test
99
shell: bash
10+
11+
- name: Report test coverage
12+
if: always()
13+
uses: davelosert/vitest-coverage-report-action@v2
14+
with:
15+
vite-config-path: ./packages/tests-unit/vitest.config.ts

.github/workflows/check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
validate:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v4

packages/tests-unit/vitest.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export default defineConfig({
1717
"**/dist/**",
1818
"**/coverage/**",
1919
],
20+
reporter: ["text", "html", "json", "json-summary"],
21+
reportOnFailure: true,
2022
},
2123
root: "../../",
2224
include: ["packages/tests-unit/**/*.{test,spec}.?(c|m)ts"],

0 commit comments

Comments
 (0)