docs: require tests for all changes in CLAUDE.md
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 58s
CI / Lint & Test (pull_request) Successful in 19m4s
CI / Build Linux (pull_request) Successful in 23m39s
CI / Build Windows (cross-compile) (pull_request) Successful in 41m43s

This commit is contained in:
2026-03-03 17:46:31 -08:00
committed by Naomi Carrigan
parent 67bae9a33c
commit 9061098b0f
+4 -4
View File
@@ -39,7 +39,7 @@ git push https://hikari:TOKEN@git.nhcarrigan.com/nhcarrigan/hikari-desktop.git <
## Testing Requirements ## Testing Requirements
All new features, fixes, and significant changes should include tests whenever possible: **All changes MUST include tests.** This is non-negotiable — no feature, bug fix, or refactor should be committed without corresponding test coverage. If a change cannot be tested (e.g. pure UI layout, Tauri IPC calls that are impossible to mock), document why in a comment.
- **Frontend tests**: Use Vitest with `@testing-library/svelte` for component tests - **Frontend tests**: Use Vitest with `@testing-library/svelte` for component tests
- **Test files**: Place test files next to the code they test with `.test.ts` or `.spec.ts` extension - **Test files**: Place test files next to the code they test with `.test.ts` or `.spec.ts` extension
@@ -137,16 +137,16 @@ describe("FeatureName", () => {
}); });
``` ```
### Adding Tests for New Features ### Adding Tests for All Changes
When developing new features, always add corresponding tests: Every change — features, bug fixes, refactors — must include tests:
1. **Before implementing**: Consider what needs testing (happy path, edge cases, errors) 1. **Before implementing**: Consider what needs testing (happy path, edge cases, errors)
2. **During implementation**: Write tests alongside the code 2. **During implementation**: Write tests alongside the code
3. **After implementation**: Run `pnpm test:coverage` to verify coverage remains high 3. **After implementation**: Run `pnpm test:coverage` to verify coverage remains high
4. **Before committing**: Ensure `check-all.sh` passes (includes all tests) 4. **Before committing**: Ensure `check-all.sh` passes (includes all tests)
The goal is to maintain our near-100% coverage as the codebase grows, so future refactoring and changes can be made with confidence! **Do not commit changes without tests.** The goal is to maintain near-100% coverage as the codebase grows, so future refactoring can be done with confidence!
## Quality Assurance ## Quality Assurance