Add Vitest coverage for frontend tests

- Install @vitest/coverage-v8
- Configure coverage in vitest.config.ts
- Add npm script: test:coverage
- Add coverage/ to gitignore
This commit is contained in:
counterweight 2025-12-21 22:00:47 +01:00
parent 37de6f70e0
commit 521848217d
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
5 changed files with 582 additions and 1 deletions

View file

@ -8,6 +8,7 @@
"build": "next build",
"start": "next start",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:e2e": "playwright test",
"generate-api-types": "openapi-typescript http://localhost:8000/openapi.json -o app/generated/api.ts",
"lint": "eslint .",
@ -28,6 +29,7 @@
"@types/node": "25.0.3",
"@types/react": "19.2.7",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.9",
"eslint": "^9.39.2",
"eslint-plugin-react-hooks": "^7.0.1",
"jsdom": "^26.0.0",