← Back to list

unit-testing
by JasonPaff
Website for Bobblehead Collectors
⭐ 2🍴 0📅 Jan 19, 2026
SKILL.md
name: unit-testing description: Enforces project unit testing conventions for pure functions, validation schemas, and utility modules using Vitest with proper isolation and mocking.
Unit Testing Skill
Purpose
This skill provides unit testing conventions for isolated tests of pure functions, Zod validation schemas, and utility modules. Unit tests run without database or external service dependencies.
Activation
This skill activates when:
- Creating or modifying files in
tests/unit/ - Testing Zod validation schemas
- Testing pure utility functions
- Testing data transformers or formatters
File Patterns
tests/unit/**/*.test.ts
Workflow
- Detect unit test work (file path contains
tests/unit/) - Load
references/Unit-Testing-Conventions.md - Also load
testing-baseskill for shared conventions - Apply unit test patterns with proper isolation
- Validate no database or external service dependencies
Key Patterns (REQUIRED)
Test Structure
- Use
describe/itblocks (no imports - globals enabled) - Follow Arrange-Act-Assert pattern
- Test pure functions in isolation
- Mock ALL external dependencies with
vi.mock()
Validation Schema Testing
- Test valid input scenarios
- Test invalid input scenarios with specific error expectations
- Test edge cases (empty strings, null, undefined, boundary values)
- Use
safeParsefor validation testing
Isolation Requirements
- NO database access in unit tests
- NO MSW handlers needed (no API calls)
- Mock external imports with
vi.mock() - Tests should run without any external services
References
references/Unit-Testing-Conventions.md- Complete unit testing conventions
Score
Total Score
40/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon