Test ve Coverage Komutları¶
ÖN KOŞUL (Backend): Docker Desktop açık olmalı. Testler
testcontainersile geçici bir CockroachDB başlatır; tablolargolang-migrateile otomatik kurulur, test bitince container silinir.
Backend (Go) Testleri¶
cd backend
# Tüm testleri çalıştır
APP_ENV=test go test ./...
# Sadece register paketini test et
APP_ENV=test go test ./internal/auth/register/...
# Coverage raporu oluştur
APP_ENV=test go test ./... -coverprofile=coverage.out
# HTML coverage raporu al
go tool cover -html=coverage.out -o coverage.html
# Tarayıcıda aç (macOS)
open coverage.html
Not:
APP_ENV=testbelirtilmezse testler yine çalışır; ancak log çıktısı gürültülü olur.
Frontend (Flutter) Testleri¶
cd app
# Tüm testleri çalıştır
flutter test
# Coverage raporu oluştur
flutter test --coverage
# HTML coverage raporu al
genhtml coverage/lcov.info -o coverage/html
# Tarayıcıda aç (macOS)
open coverage/html/index.html
Verbose Modda Testler¶
# Backend verbose
cd backend
APP_ENV=test go test -v ./internal/auth/register/...
# Flutter verbose
cd app
flutter test --verbose