Back to list
PlosinBen

testing-guidelines

by PlosinBen

0🍴 0📅 Jan 22, 2026

SKILL.md


name: testing-guidelines description: Rules for when and how to run tests during development

Testing Guidelines

Rules that AI should automatically follow during development.

Backend API Testing

When adding or modifying Backend API:

  1. Ensure corresponding test file exists (*_test.go)
  2. New APIs must include test cases
  3. Run all Go tests:
docker compose exec backend go test ./...
  1. All tests must pass before completion

Test File Locations

  • Handler tests: internal/handlers/*_test.go
  • Service tests: internal/services/*_test.go

Frontend Browser Testing

When modifying frontend pages:

  1. Use browser_subagent to simulate user behavior on that page
  2. Do NOT write JavaScript test code
  3. Tests should cover the modified functionality flow

Testing Principles

  • Simulate real user actions (click, type, navigate)
  • Verify UI state changes
  • Verify API call results are reflected in the UI

Example Test Flow

1. Open target page
2. Perform user actions (click buttons, fill forms)
3. Verify page displays correct results
4. Report test results

Database Schema Changes

When modifying database schema (add/modify migrations):

  1. Reset database
  2. Run all API tests (which creates test data)
# 1. Drop and recreate database
docker compose exec postgres psql -U postgres -c "DROP DATABASE IF EXISTS lovelion"
docker compose exec postgres psql -U postgres -c "CREATE DATABASE lovelion"

# 2. Run migrations
docker compose exec backend migrate -path /app/migrations -database "$DATABASE_URL" up

# 3. Run API tests (creates test data)
docker compose exec backend go test ./...

Summary Table

ScenarioAutomatic Action
Add/modify Backend APIRun all Go tests
Modify frontend pageBrowser test that page
Modify database schemaReset DB + Run all API tests

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