Skip to content

Commit a0a22fa

Browse files
committed
feat(coverage): add test coverage checks
Add test coverage to package.json scripts and github actions. Thresholds were set to current state.
1 parent 8080e1d commit a0a22fa

File tree

6 files changed

+617
-1355
lines changed

6 files changed

+617
-1355
lines changed

.github/workflows/create-prerelease-sdk.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ jobs:
3131
- name: Install dependencies
3232
run: pnpm install
3333

34-
- name: Run tests
35-
run: pnpm test
34+
- name: 'Run unit tests'
35+
run: npx vitest --coverage.enabled true
36+
37+
- name: 'Report Coverage'
38+
# Set if: always() to also generate the report if tests are failing
39+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
40+
if: always()
41+
uses: davelosert/vitest-coverage-report-action@v2
3642

3743
semantic-release:
3844
needs: build-and-test

.github/workflows/create-release-sdk.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ jobs:
3131
- name: Install dependencies
3232
run: pnpm install
3333

34-
- name: Run tests
35-
run: pnpm test
34+
- name: 'Run unit tests'
35+
run: npx vitest --coverage.enabled true
36+
37+
- name: 'Report Coverage'
38+
# Set if: always() to also generate the report if tests are failing
39+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
40+
if: always()
41+
uses: davelosert/vitest-coverage-report-action@v2
3642

3743
semantic-release:
3844
needs: build-and-test

.github/workflows/dryrun-release-ci-sdk.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ jobs:
2929
- name: Install dependencies
3030
run: pnpm install
3131

32-
- name: Run tests
33-
run: pnpm test
32+
- name: 'Run unit tests'
33+
run: npx vitest --coverage.enabled true
34+
35+
- name: 'Report Coverage'
36+
# Set if: always() to also generate the report if tests are failing
37+
# Only works if you set `reportOnFailure: true` in your vite config as specified above
38+
if: always()
39+
uses: davelosert/vitest-coverage-report-action@v2
3440

3541
semantic-release:
3642
needs: build-and-test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ yarn-debug.log*
1919
yarn-error.log*
2020
.DS_Store
2121
/.idea
22-
stats.html
22+
stats.html
23+
coverage/

0 commit comments

Comments
 (0)