987 B
987 B
Project TDD Standards
Location: .claude/context/test-driven-development-start.md
Triggered by: When test-driven-development skill loads (SkillStart hook)
This project uses:
- Test framework: Vitest
- Test location:
src/**/__tests__/*.test.ts - Coverage requirement: 80% line coverage minimum
- Property testing: Use fast-check for algorithms
File Structure
src/
components/
Button/
Button.tsx
__tests__/
Button.test.tsx
Naming Convention
- Use
describe/itblocks (nottest()) - Test names: "should [behavior] when [condition]"
- File naming:
{Component}.test.ts
Mocking Strategy
- Mock external services (APIs, databases)
- Do NOT mock internal modules (test real behavior)
- Use MSW for HTTP mocking
RED-GREEN-REFACTOR
- Write failing test first
- Run test (verify it fails for right reason)
- Write minimal code to pass
- Run test (verify it passes)
- Refactor (if needed)
- Commit