← スキル一覧に戻る

writing-tests
by hotovo
writing-testsは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 1,022🍴 79📅 2026年1月23日
SKILL.md
name: Writing Tests description: Comprehensive guide for writing unit tests, integration tests, and component tests in AiderDesk using Vitest. Use when creating new tests, configuring mocks, or organizing test files.
Writing Tests
Write effective tests using Vitest and React Testing Library.
Quick Start
Create a unit test in src/common/__tests__/utils/math.test.ts:
import { describe, it, expect } from 'vitest';
import { add } from '../../utils/math';
describe('math utility', () => {
it('adds two numbers correctly', () => {
expect(add(1, 2)).toBe(3);
});
});
Run tests with npm run test.
Core Patterns
Unit Testing
Focus on pure functions and logic in src/main or src/common. Use vi.mock() for dependencies.
Component Testing
Test React components in src/renderer. Focus on user interactions and props.
Mocking
Use centralized mock factories for consistent testing across components and contexts.
- references/mocking-guide.md - Mock factories and API patterns
Advanced Usage
For detailed information:
- references/test-organization.md - Directory structure and naming
- references/running-tests.md - CLI commands and coverage
- references/best-practices.md - Principles and patterns
- references/test-patterns.md - Code templates
- assets/test-checklist.md - Pre-flight checklist
スコア
総合スコア
80/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 1000以上
+15
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
○Issue管理
オープンIssueが50未満
0/5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です


