feat: add hooks and rules

This commit is contained in:
duthaho
2026-04-19 12:11:56 +07:00
parent 5d87f8c1f3
commit 3103a8da1b
9 changed files with 233 additions and 8 deletions
+19
View File
@@ -0,0 +1,19 @@
---
paths:
- "**/*.test.*"
- "**/*.spec.*"
- "**/tests/**"
- "**/test_*"
- "**/__tests__/**"
---
# Test Writing Rules
- Python test naming: `test_[function]_[scenario]_[expected]`
- TypeScript test naming: `describe('[Component]', () => { it('should [behavior]') })`
- Each test file must have at least one happy path and one error case
- Mock external dependencies, not internal modules
- Use factories/fixtures over inline test data
- Never commit `.skip()` or `.only()` — remove before pushing
- Minimum coverage: 80% overall, 95% for critical paths
- Prefer pytest for Python, vitest for TypeScript