Skip to content

Commit 313adcc

Browse files
committed
chore(pre-commit): add unit test hooks for backend and frontend
- Add test-backend hook to run Vitest for backend TypeScript files - Add test-frontend hook to run Vitest for frontend TypeScript files with no-test pass-through - Configure hooks to trigger on TypeScript file changes in respective directories - Ensure unit tests run automatically during pre-commit phase for code quality
1 parent 577f09d commit 313adcc

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,22 @@ repos:
6161
files: ^frontend/
6262
pass_filenames: false
6363

64+
- id: test-backend
65+
name: Unit Tests (Backend)
66+
entry: bash -c 'cd backend && npx vitest --run'
67+
language: system
68+
types_or: [ts, tsx]
69+
files: ^backend/
70+
pass_filenames: false
71+
72+
- id: test-frontend
73+
name: Unit Tests (Frontend)
74+
entry: bash -c 'cd frontend && npx vitest --run --passWithNoTests'
75+
language: system
76+
types_or: [ts, tsx]
77+
files: ^frontend/
78+
pass_filenames: false
79+
6480
# Prevent duplicate/backup files
6581
- repo: local
6682
hooks:

0 commit comments

Comments
 (0)