Skip to content

Test coverage gaps: no Shmuelie.Node tests; destructive session cmdlets and Update-Worktrees untested #35

Description

@shmuelie

Summary

The most complex and most destructive logic in the repo has no test coverage,
and one whole module has no test file at all. The contributing guide asks for
tests alongside behavioral code.

Gaps

  • Shmuelie.Node has no test file. tests\ contains only
    Shmuelie.Copilot.Tests.ps1, Shmuelie.Git.Tests.ps1, and
    Shmuelie.Utilities.Tests.ps1. In particular NpmHelpers.ps1 parses
    npm outdated --json / npm list --json, which some npm versions pollute with
    non-JSON warnings on stdout — no regression protection.
  • Destructive Copilot session cmdlets are untested.
    Merge-CopilotSession / Compress-CopilotSession /
    Repair-CopilotSessionEvents (JSONL re-serialization, checkpoint renumbering,
    rewind-snapshot merging) have zero references in
    tests\Shmuelie.Copilot.Tests.ps1, yet they rewrite/delete session data with
    -RemoveSource / Remove-Item -Recurse -Force (irreversible).
  • Update-Worktrees is untested (tests\Shmuelie.Git.Tests.ps1 has no
    reference), despite mutating worktrees and stashing.

Recommendation

Add deterministic Pester tests using synthetic session directories / temporary
git repos under $TestDrive, covering: sessions with missing optional files,
out-of-order timestamps, empty snapshot indexes, and a round-trip
merge/compact/repair that asserts the resulting events.jsonl is still valid
line-delimited JSON; and a Get-NpmPackage/Update-NpmPackage test against
mocked npm JSON. See also the related workspace.yaml-parser test request.

Filed from an automated peer review (Skeptic persona); please validate before acting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions