← スキル一覧に戻る

testing
by kprsnt2
⭐ 0🍴 0📅 2026年1月15日
SKILL.md
name: testing description: Testing patterns and best practices for unit, integration, and E2E testing. globs: ["/*.test.js", "/.spec.js", "**/.test.ts", "/*.spec.ts", "/test/", "/tests/", "/tests/", "/jest.config.", "**/vitest.config.", "/playwright.config.*", "/cypress.config.*"] priority: 85 tags: ["workflow"]
Testing Best Practices
Test Structure (AAA Pattern)
- Arrange: Set up test data and conditions
- Act: Execute the code under test
- Assert: Verify the expected outcome
- Use descriptive test names: "should X when Y"
Unit Tests
- Test one behavior per test
- Mock external dependencies
- Test edge cases and error paths
- Keep tests fast (< 100ms each)
- Use factories for test data
- Aim for 80%+ coverage
Integration Tests
- Test component interactions
- Use test database/containers
- Clean up after tests
- Test happy and error paths
- Use realistic data
E2E Tests
- Test critical user flows only
- Keep tests independent
- Use stable selectors (data-testid)
- Handle async properly
- Run in CI with retries
Mocking
- Mock at boundaries (APIs, DB)
- Use factories for test data
- Don't over-mock (test real behavior)
- Reset mocks between tests
- Prefer fakes over mocks when possible
Tools
- Jest/Vitest for unit tests
- Playwright/Cypress for E2E
- MSW for API mocking
- Faker for test data
- Testing Library for component tests
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です