Skip to content

[PHASE 1] Move Tests Out of .jest-skip/ and Add Missing Coverage #602

@ashleyshaw

Description

@ashleyshaw

Problem

Tests disabled in .jest-skip/ directory; critical gaps in coverage; error branches untested.

Acceptance Criteria

  • Test files moved from .jest-skip/ to scripts/agents/__tests__/
  • All tests pass in CI (npm test)
  • Test coverage ≥ 80% for both agents
  • All error branches tested (missing token, API failure, etc.)
  • Blocker detection tested thoroughly
  • .jest-skip/ directory removed (once tests moved)

Implementation Plan

Move & Structure

  1. Move .jest-skip/planner.agent.test.jsscripts/agents/__tests__/planner.agent.test.js
  2. Move .jest-skip/reviewer.agent.test.jsscripts/agents/__tests__/reviewer.agent.test.js

Planner Tests

Add tests for:

Reviewer Tests

Add tests for:

  • Missing GITHUB_TOKEN → should fail with clear error
  • CI failure state (state !== "success") → should flag as blocker
  • No changed files → should handle gracefully
  • Changelog detection edge cases:
    • Case-insensitive (CHANGELOG.md, changelog.md, Changelog.MD)
    • Multiple names (CHANGELOG.md, HISTORY.md, NEWS.md)
    • In root and /docs directory
  • Blocker detection:
    • Both CI + changelog blockers
    • No blockers (ready to proceed)
  • Dry-run mode → should not post comment
  • Comment posting success → verify octokit called
  • Comment posting failure → should fail gracefully

Test Execution Plan

# Run all tests
npm test

# Run with coverage
npm test -- --coverage scripts/agents

# Check coverage report
# Should show ≥ 80% for:
# - scripts/agents/planner.agent.js
# - scripts/agents/reviewer.agent.js

Effort Estimate

Medium (2-3 hours)

Priority

🔴 CRITICAL - Blocks CI validation

Dependencies

Blocks

  • Enables all Phase 2 issues

Related Issues

  • Blocked by: Issue 1.1, 1.2, 1.3
  • Reference: ai/improvement-plan-planner-reviewer.md (Issue 1.4)
  • Test patterns: instructions/quality-assurance.instructions.md

References

  • .jest-skip/planner.agent.test.js
  • .jest-skip/reviewer.agent.test.js
  • tests/test-helpers.js (verify mock functions exist)
  • ai/audit-planner-reviewer-agents.md (Section 4)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions