test(enrichment): cover churn-hotspot empty-list and threshold boundaries - #3385
Conversation
…ries Adds edge cases the existing threshold test omits: summarizeChurn on an empty commit list (the divide-by-zero guard's else branch → fixFraction 0), and isHotspot at the exact inclusive `>=` thresholds (commits 8, fixFraction 0.3) plus one step below each. Test-only.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 05:54:24 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Hardens unit coverage for the
churn-hotspotanalyzer's pure helpers with two edge cases the existing threshold test doesn't exercise:summarizeChurn([])— an empty commit list must be zero churn (fixFraction: 0), exercising thecommitCount ? fixCount / commitCount : 0divide-by-zero guard's else branch (the existing test only feeds 10 commits).isHotspotat the exact>=thresholds —{commitCount: 8, fixFraction: 0.3}is inclusive (a hotspot), while one step below either floor (7commits, or0.29fix-fraction) is not. The existing test only checks values well above/below, not the boundary.Test-only, against the compiled
dist/, in the analyzer's own test file. No source or shared-registry change; the pure helpers are already imported by this file, so no new import surface.No linked issue — straightforward boundary/edge coverage hardening of pure functions; changes no runtime behavior.
Scope
review-enrichment/test/churn-hotspot.test.ts. Nosite//CNAME/**/lovable/**; noCHANGELOG.md.Validation
npm --prefix review-enrichment test— 966 pass / 0 fail (build + sourcemap validate +metadata --check+ node tests; exactly CI).git diff --checkclean.Safety