Skip to content

test : added unit tests for consistency-score isRecentlyActiveFromScore - #2635

Closed
tmdeveloper007 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#2634
Closed

test : added unit tests for consistency-score isRecentlyActiveFromScore#2635
tmdeveloper007 wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#2634

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Closes #2634.

Summary of What Has been Done:
Added test/consistency-score.test.ts covering the isRecentlyActiveFromScore function exported from src/lib/consistency-score.ts. All 10 tests pass under vitest.

Changes Made:

  • New file: test/consistency-score.test.ts (10 tests).
  • Tests the recent-activity detection logic at boundary conditions: exact threshold (recent = 10), just below threshold (recent < 10), zero baseline, high-consistency/high-streak cases, and cases where the 100-point ceiling prevents recent from exceeding the threshold.

Impact it Made:
isRecentlyActiveFromScore is used in the Repository Health Explorer UI to display a "recently active" badge on the consistency score. The test ensures the 10-point recent-activity threshold is correctly enforced, preventing false-positive active badges when a user has good underlying scores but no recent commits.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:testing GSSoC type bonus: tests (+10 pts) labels Jun 21, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Umbrella-io — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

CI is failing on this PR. Please fix the TypeScript/test errors before we can merge. Run npm run typecheck and npm test locally to reproduce.

@tmdeveloper007

Copy link
Copy Markdown
Author

This PR has been closed as it has been stale for more than 2 days without recent activity or merging. If this work is still relevant, please reopen a fresh PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test : add unit tests for consistency-score grade and tip helpers

2 participants