Skip to content

Commit

Permalink
Configure Coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 committed Dec 23, 2024
1 parent deedd16 commit 61dd645
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# Test Coverage
tests/coverage

node_modules
dist
dist-ssr
Expand Down
144 changes: 144 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:ui": "vitest --ui",
"test:ui": "vitest --ui --coverage.enabled=true",
"coverage": "vitest run --coverage",
"format": "prettier --write .",
"lint": "eslint .",
"preview": "vite preview",
Expand All @@ -30,6 +31,7 @@
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/eslint-plugin": "^1.1.18",
"@vitest/ui": "^2.1.8",
"autoprefixer": "^10.4.20",
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ export default defineConfig({
environment: "jsdom",
setupFiles: "./tests/setup.ts",
exclude: [...configDefaults.exclude, "./firebase", "./config"],
coverage: {
provider: "v8",
include: ["src"],
skipFull: true,
clean: true,
reporter: ["html", "text"],
reportsDirectory: "./tests/coverage",
},
},
resolve: {
alias: {
Expand Down

0 comments on commit 61dd645

Please sign in to comment.