Skip to content

Add unit tests for buildProfile() style analysis #236

Description

@404-Page-Found

Description

The style-learning feature analyzes commit history via \�uildProfile()\ in \src/history/store.ts\ (imperative mood, common prefixes, scope usage, body usage). There are no dedicated unit tests covering the profile-building logic, which is core to suggestion quality.

Problem Statement

Regressions in profile detection (e.g., misclassifying scope usage) would go unnoticed without tests.

Proposed Solution

Add .mjs\ unit tests under \ ests/\ that feed known JSONL history samples and assert on the resulting \StyleProfile\ fields (mood, common prefixes, scope usage ratio, body usage ratio).

Acceptance Criteria

  • Tests cover imperative-mood detection
  • Tests cover scope-usage and body-usage ratios
  • Tests cover empty / minimal history edge case

Dependencies

None — pure function, no network or git required.

Additional Context

Project uses Node built-in
ode:test\ runner; run with
pm test. See \src/history/store.ts\ (\�uildProfile, \ ormatProfile).

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions