test: avoid duplicating github stars fallback

This commit is contained in:
Benjamin Lu
2026-05-06 07:58:26 -07:00
parent ca48ec86eb
commit 4f94104faf

View File

@@ -56,9 +56,12 @@ describe('fetchGitHubStars', () => {
it('falls back to the last known star count for build-time fetch failures', async () => {
const fetchImpl = vi.fn(async () => new Response(null, { status: 403 }))
await expect(
fetchGitHubStarsForBuild(fetchImpl as unknown as typeof fetch)
).resolves.toBe(111605)
const fallback = await fetchGitHubStarsForBuild(
fetchImpl as unknown as typeof fetch
)
expect(Number.isSafeInteger(fallback)).toBe(true)
expect(fallback).toBeGreaterThan(0)
})
})