Skip to content

test : add unit tests for digest-email.ts #2860

Description

@tmdeveloper007

Summary of What Needs to be Done:
Add unit tests for the digest-email.ts utility module covering esc, pluralise, langColour, buildDigestHtml, and buildDigestText functions.

Changes that Need to be Made:

  • Create test/digest-email.test.ts
  • Add tests for esc function (HTML escaping)
  • Add tests for pluralise (singular/plural forms)
  • Add tests for langColour (returns correct hex or fallback)
  • Add tests for buildDigestHtml (greeting, weekLabel, unsubscribe, streak, activity, languages, repos, HTML escaping)
  • Add tests for buildDigestText (greeting, streak with emoji, activity, languages with percentages, repos)

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

Hello @Priyanshu-byte-coder, please assign this issue to me (@tmdeveloper007) so I can open a focused PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions