Skip to content

test : added unit tests for digest-email.ts#2865

Open
tmdeveloper007 wants to merge 2 commits into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#2860
Open

test : added unit tests for digest-email.ts#2865
tmdeveloper007 wants to merge 2 commits into
Priyanshu-byte-coder:mainfrom
tmdeveloper007:#2860

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Closes #2860.

Summary of What Has Been Done:
Added a comprehensive test suite for the digest-email.ts utility module covering esc, pluralise, langColour, buildDigestHtml, and buildDigestText functions.

Changes Made:

  • Created test/digest-email.test.ts with 19 test cases
  • Tested esc function with HTML special characters
  • Tested pluralise with singular and plural forms
  • Tested langColour with known and unknown language names
  • Tested buildDigestHtml with greeting, weekLabel, unsubscribe, streak, activity, languages, repos, and HTML escaping
  • Tested buildDigestText with greeting, streak with emoji, activity, language percentages, and repo listing

Impact it Made:
Increases test coverage for the lib directory and ensures email template generation handles all edge cases correctly.

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

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — 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

@github-actions github-actions Bot added the gssoc26 GSSoC 2026 contribution label Jun 27, 2026
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 digest-email.ts

1 participant