Proje: Okul B2B App · Hub: Okul B2B App — Conventions

Test Yapısı

Test Dosyaları

__tests__/
  SimpleErrorHandler.test.ts    ← SimpleErrorHandler unit test
  templates/                    ← Test template'leri
services/__tests__/
  MediaService.test.ts          ← MediaService unit test

Test Framework

  • Jest ~29.7.0
  • jest-expo ~54.0.13
  • @testing-library/react-native ^13.2.0

SimpleErrorHandler Test Coverage

  • API mesaj extraction (ServerError body’den)
  • Türkçe büyük harf: 'geçersiz' → 'Geçersiz'
  • Nested response body: { data: { message } }
  • Network error handling
  • Default error message fallback

MediaService Test

  • Dosya yükleme operasyonları
  • FormData oluşturma
  • Platform-specific file object

Çalıştırma

npx jest --testPathPattern=SimpleErrorHandler  # Tek test
npx jest                                        # Tüm testler (yavaş!)