Skip to content

Commit

Permalink
setup coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Jan 3, 2025
1 parent 9d0f39f commit 70751d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ jobs:
run: CI="" yarn install --frozen-lockfile

- name: Run Unit Test
run: cd packages/client && yarn test -- --shard $(( ${{ strategy.job-index }} + 1 ))/${{ strategy.job-total }}
run: cd packages/client && yarn test -- --shard $(( ${{ strategy.job-index }} + 1 ))/${{ strategy.job-total }} --coverage.enabled true

- name: Report coverage
uses: davelosert/vitest-coverage-report-action@v2
if: always()

lint-knip:
name: Lint unused exports with Knip
Expand Down
3 changes: 1 addition & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"build": "NODE_OPTIONS=--max_old_space_size=8000 vite build",
"docker:build": "docker build ../../ -f ../../Dockerfile-register -t ocrvs-client",
"docker:run": "docker run -it --rm -p 5000:80 --name ocrvs-client ocrvs-client",
"test": "NODE_OPTIONS=--max_old_space_size=8000 vitest run --coverage --silent --dangerouslyIgnoreUnhandledErrors",
"test": "NODE_OPTIONS=--max_old_space_size=8000 vitest run --silent --dangerouslyIgnoreUnhandledErrors",
"test:watch": "vitest",
"open:cov": "yarn test && opener coverage/index.html",
"lint": "yarn lint:css && yarn lint:ts",
"lint:css": "stylelint 'src/**/*.{ts,tsx}'",
"lint:ts": "eslint --fix './src/**/*.{ts,tsx}' --max-warnings=353",
Expand Down
3 changes: 2 additions & 1 deletion packages/client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export default defineConfig(({ mode }) => {
hookTimeout: 60000,
globals: true,
coverage: {
reporter: ['text', 'json', 'html']
reporter: ['text', 'json-summary', 'json'],
reportOnFailure: true
}
},
server: {
Expand Down

0 comments on commit 70751d8

Please sign in to comment.