Skip to content

test(#317): add unit tests for exported utility functions - #346

Merged
admarble merged 2 commits into
mainfrom
feature/317-improve-run-add-unit-tests
Mar 11, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/317-improve-run-add-unit-tests

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Export determinePhasesForIssue for unit testability
  • Add 6 tests for getWorktreeDiffStats (parsing git diff stat output, edge cases, error handling)
  • Add 9 tests for determinePhasesForIssue (testgen insertion, UI label detection, phase ordering, immutability)
  • Total: 111 tests in run.test.ts (up from 96)

Context

Most functions listed in #317 already had test coverage. The remaining gaps were:

  • getWorktreeDiffStats — zero tests (now 6)
  • determinePhasesForIssue — not exported, zero tests (now exported + 9 tests)
  • filterResumedPhases — already well-tested in run-resume.test.ts

Test plan

  • All 111 tests in run.test.ts pass
  • filterResumedPhases already covered in run-resume.test.ts (7 tests)
  • TypeScript compiles with no errors
  • No regressions in existing tests

Fixes #317

🤖 Generated with Claude Code

…esForIssue

Export determinePhasesForIssue for testability. Add 15 new tests covering
diff stat parsing (happy path, edge cases, failures) and phase determination
logic (testgen insertion, UI label detection, immutability).

Fixes #317
Cover resume=true/false paths, all-completed, none-completed,
and immutability of input array.
@admarble
admarble merged commit 7bcc65a into main Mar 11, 2026
5 of 6 checks passed
@admarble
admarble deleted the feature/317-improve-run-add-unit-tests branch March 11, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve(run): add unit tests for exported utility functions

1 participant