スキル一覧に戻る
Spycner

testing-standards

by Spycner

0🍴 0📅 2025年12月9日
GitHubで見るManusで実行

SKILL.md


name: testing-standards description: Testing conventions, test runner configurations, coverage requirements, and failure interpretation for the Klassenzeit monorepo.

Testing Standards

Test Runner Commands

Backend (Spring Boot / JUnit)

make test-backend           # Run all backend tests
./gradlew test              # Direct Gradle command
./gradlew test --tests "ClassName"  # Run specific test class

Frontend (Vitest / React Testing Library)

make test-frontend          # Run all frontend tests
npm run test                # Run tests once
npm run test:watch          # Watch mode
npm run test:coverage       # With coverage report
npm run test:ui             # Vitest UI

E2E (Playwright)

make test-e2e               # Run all E2E tests
npm run test:e2e            # Direct Playwright run
npm run test:e2e:ui         # Playwright UI mode
npm run test:api            # API integration tests only

Coverage Reports

TypeLocationMinimum Threshold
Backendbackend/build/reports/jacoco/test/html/index.html80% line coverage
Frontendfrontend/coverage/index.html80% line coverage
E2Ee2e/playwright-report/index.htmlCritical paths covered

Coverage Requirements

  • New code: Minimum 80% line coverage
  • Public API functions: Must have unit tests
  • Critical user flows: Must have E2E tests
  • Edge cases: Error scenarios must be tested

Interpreting Failures

Priority Order

  1. Check if failure is flaky (re-run once with same seed)
  2. Look for recent changes to test file or tested module
  3. Check for environment issues (missing fixtures, DB state, port conflicts)
  4. Inspect assertion messages carefully for root cause

Common Failure Patterns

Backend

  • NullPointerException: Missing mock setup or fixture data
  • ConstraintViolationException: Invalid test data for entity constraints
  • LazyInitializationException: Missing @Transactional or eager fetch

Frontend

  • Unable to find element: Component not rendered, wrong query, async timing
  • act() warning: State update outside test act boundary
  • Mock not called: Wrong mock path or missing mock setup

E2E

  • Timeout: Slow page load, element not visible, wrong selector
  • Element not attached: DOM changed between find and action
  • Navigation error: Auth redirect, missing route, CORS issue

Test File Conventions

  • Backend: src/test/java/**/*Test.java
  • Frontend: src/**/*.test.tsx (co-located with source)
  • E2E: e2e/tests/**/*.spec.ts

Pre-Test Checklist

  1. Services running (make services-up)
  2. Database migrated (Flyway runs on backend startup)
  3. Environment variables set (.env files in place)
  4. Dependencies installed (npm install in frontend/e2e)

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

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

レビュー

💬

レビュー機能は近日公開予定です