Skip to content

Add unit tests for git utils, display, and CLI commands #23

@that-github-user

Description

@that-github-user

Summary

Major test coverage gaps — several modules have zero tests:

Module Tests Coverage
src/commands/run.ts 0 None
src/commands/list.ts 0 None
src/runners/claude-code.ts 0 None
src/utils/git.ts 0 None — critical git operations untested
src/utils/display.ts 0 None

Priority tests to add

git.ts (highest priority)

  • createWorktree() — creates worktree, returns path
  • removeWorktree() — cleans up worktree
  • getDiff() — returns diff string
  • getDiffStats() — parses diff stats correctly
  • cleanupBranches() — removes thinktank/* branches

display.ts

  • padRight() — handles ANSI codes in length calculation
  • formatDuration() — seconds and minutes formatting

Integration tests

  • Full run → apply workflow against a test fixture
  • Worktree cleanup on failure
  • Concurrent agent execution

Acceptance criteria

  • Tests for git.ts core functions
  • Tests for display utilities
  • At least one integration test for the run→apply flow
  • Test coverage report added to CI

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