Commit graph

2 commits

Author SHA1 Message Date
Till JS
9a735d0a2b fix(api): vi.fn() in lib-url-fetch.test typt zu typeof fetch
Some checks are pending
CI / validate (push) Waiting to run
5 tsc-Errors „Property 'preconnect' is missing in type Mock". Bun's
`typeof fetch` deklariert eine `preconnect(url, options)`-Methode,
vitests `vi.fn()`-Mock hat die nicht. Cast über `unknown` umgeht den
strikten Type-Check, ohne den Mock künstlich aufzublähen.

- makeFetch() bekommt `typeof globalThis.fetch` als Return-Type
- direkter inline-vi.fn().mockRejectedValue() cast'd am Use-Site
- 6/6 Tests grün

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 15:07:14 +02:00
Till JS
26b136a42c test(api): Unit-Tests für makeInitialReviewRows und fetchUrlContent
Some checks are pending
CI / validate (push) Waiting to run
- lib-reviews.test.ts: 5 Tests — subIndex-Count, userId/cardId, leere
  Input-Liste, Initialzustand (reps=0, lapses=0), due ist Date
- lib-url-fetch.test.ts: 6 Tests — mana-search Pfad, Fallback auf
  direktes Fetch, HTML-Stripping, Network-Fehler, leerer Content,
  Truncation auf 8000 Zeichen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-10 16:40:30 +02:00