Skip to content

Commit

Permalink
try vitest coverage gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHaff committed Feb 8, 2024
1 parent 74c6e55 commit ebc50e1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ jobs:
pnpm test
env:
TEST_USER: ${{ steps.json.outputs.encoded }}
- name: Report Coverage
if: always()
uses: davelosert/vitest-coverage-report-action@v2
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint:ci": "pnpm -r lint:ci",
"lint:fix": "pnpm -r lint:fix",
"test": "pnpm -r test -- --run",
"test": "pnpm -r test:ci",
"test:coverage": "pnpm -r test:coverage",
"typecheck": "pnpm -r typecheck"
},
Expand Down
1 change: 1 addition & 0 deletions packages/event-producer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"lint:fix": "pnpm run lint --fix",
"preview": "vite preview",
"test": "vitest --sequence.concurrent",
"test:ci": "pnpm run test:coverage --reporter=json-summary --reporter=json",
"test:coverage": "pnpm run test --coverage",
"test:ui": "pnpm run test:coverage --ui",
"typecheck": "tsc"
Expand Down
7 changes: 7 additions & 0 deletions packages/player-web-components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export default defineConfig({
},
test: {
coverage: {
reportOnFailure: true,
reporter: process.env.CI ? ['json', 'json-summary'] : ['html'],
thresholds: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
globals: true,
restoreMocks: true,
Expand Down

0 comments on commit ebc50e1

Please sign in to comment.