Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,30 @@ jobs:
npm test -- src/test/regression.test.ts
fi

# -----------------------------------
# Coverage generation (refs #39)
# -----------------------------------
- name: Run tests with coverage
run: |
if [ "${{ steps.pm.outputs.manager }}" = "pnpm" ]; then
pnpm test:coverage
elif [ "${{ steps.pm.outputs.manager }}" = "yarn" ]; then
yarn test --coverage
else
npm run test:coverage
fi

# -----------------------------------
# Upload coverage report as a CI artifact (refs #39)
# -----------------------------------
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: frontend-coverage
path: frontend/coverage/
if-no-files-found: error

# -----------------------------------
# Build check
# -----------------------------------
Expand Down
2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "next start",
"lint": "eslint",
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:security-headers": "node --test security-headers.test.mjs"
},
"dependencies": {
Expand Down Expand Up @@ -47,6 +48,7 @@
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"@vitest/coverage-v8": "^4.1.10",
"eslint": "^9",
"eslint-config-next": "16.1.3",
"tailwindcss": "^4",
Expand Down
128 changes: 126 additions & 2 deletions frontend/pnpm-lock.yaml

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

7 changes: 7 additions & 0 deletions frontend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@ export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.{ts,tsx}"],
coverage: {
provider: "v8",
reporter: ["text", "text-summary", "lcov", "html"],
reportsDirectory: "coverage",
include: ["src/**/*.{ts,tsx}"],
exclude: ["src/**/*.test.{ts,tsx}", "src/**/*.d.ts"],
},
},
});