Skip to content

test : add unit tests for cv-classifier.ts #3029

Closed

Description

@tmdeveloper007

Summary of What Needs to be Done: Add comprehensive unit tests for src/lib/cv/cv-classifier.ts. The module explicitly states that every function is pure with no network calls, database access, or shared state mutations. The following functions need tests: detectTechnologies, mapToDomains, scoreContributions, analyzeRepository, classifyContributions, and filterByRole.

Changes that Need to be Made:

  • Create test/cv-classifier.test.ts with Vitest
  • Test detectTechnologies: provide minimal RepositoryData arrays, verify languages are bucketed into languages/frameworks/tools correctly; verify duplicate tech items are summed; verify sorting by occurrences descending
  • Test mapToDomains: verify scores are computed correctly for Frontend/Backend domains when matching technologies are present; verify keyword bonus; verify FullStack synthetic domain is added when both Frontend and Backend scores exceed 30
  • Test scoreContributions: verify totals are summed correctly from repository data; verify avgPRSize is computed correctly; verify topLanguages are sorted by frequency
  • Test analyzeRepository: verify complexity classification (low/medium/high) based on lines changed and PR count; verify detectedDomains are populated correctly; verify relevanceByRole scores
  • Test classifyContributions: verify it produces a valid ContributionClassification object with all required fields
  • Test filterByRole: verify filtering by Frontend Developer removes non-Frontend technologies and repos with 0 relevance; verify repos are sorted by relevance descending

Impact that it would Provide: The CV classifier is a critical piece of the AI resume generation pipeline. Since it operates entirely on in-memory data (no external calls), tests are fast and deterministic. Coverage here prevents regression in contribution classification logic as the feature evolves.

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

Activity

  1. aaniya22 commented on Jul 12, 2026

    @aaniya22
    Contributor

    pls assign this to me under gssoc

  2. github-actions commented on Jul 12, 2026

    @github-actions

    Assigned to @aaniya22! You have 7 days to open a PR. No PR after 7 days = auto-unassigned so others can pick it up. Good luck!

  3. github-actions commented on Jul 19, 2026

    @github-actions

    ✅ Closed as completed!

    If DevTrack has been useful, a ⭐ star on the repo helps the project grow and reach more developers.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions