Skip to content

test : add unit tests for clamp function #676

@tmdeveloper007

Description

@tmdeveloper007

Summary of What Needs to be Done:
Add unit tests for the clamp helper function in src/lib/repo-health.ts. Tests must use vitest framework and import actual source code.

Changes that Need to be Made:

  • Create test using vitest describe/it/expect
  • Test value within range returns unchanged
  • Test value below min returns min
  • Test value above max returns max
  • Test with non-finite values

Impact that it would Provide:

  • Ensures clamp handles edge cases correctly
  • Critical for all scoring functions

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