bilhej/frontend/package.json
Joakim Mörling e654d42a4f chore: add vitest coverage enforcement to frontend
- Install @vitest/coverage-v8 as devDependency (13 packages)
- Add coverage block to vite.config.ts test config:
  - provider: 'v8' (Node.js native coverage, faster than istanbul)
  - reporters: text, html, lcov, json
  - thresholds: 70% lines, 60% branches, 70% functions, 70% statements
  - exclude: test files and e2e directory
- Add "test:coverage": "vitest run --coverage" script to package.json
- Coverage report output: frontend/coverage/index.html
  JSON output:     frontend/coverage/coverage-final.json
- Thresholds are enforced by vitest itself — build exits non-zero
  if any threshold is not met
2026-05-15 12:15:55 +02:00

43 lines
1.2 KiB
JSON

{
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
"lint": "eslint src/ --fix",
"format": "prettier --write src/",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "playwright test",
"test:e2e:ci": "docker compose -f ../docker-compose.ci.yml up --build --abort-on-container-exit --exit-code-from playwright"
},
"dependencies": {
"pinia": "^3.0.4",
"vue": "^3.5.32",
"vue-router": "^5.0.6"
},
"devDependencies": {
"@playwright/test": "^1.60.0",
"@rushstack/eslint-patch": "^1.16.1",
"@types/node": "^24.12.2",
"@vitejs/plugin-vue": "^6.0.6",
"@vitest/coverage-v8": "^4.1.6",
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.7.0",
"@vue/test-utils": "^2.4.10",
"@vue/tsconfig": "^0.9.1",
"eslint": "^10.2.1",
"eslint-plugin-vue": "^10.9.0",
"jiti": "^2.6.1",
"jsdom": "^29.1.1",
"prettier": "^3.8.3",
"typescript": "~6.0.2",
"vite": "^8.0.10",
"vitest": "^4.1.5",
"vue-tsc": "^3.2.7"
}
}