NameLast commit messageLast commit date
..
evals
scenarios
split-exec
split-rewrite-plan
test-utils
bot-author-normalize.test.ts
bot-prediction-heuristics.test.ts
branch-ref-fetch.test.ts
coderabbit-meta-comment.test.ts
consolidate-duplicate-path.test.ts
duplicate-cluster-ids.test.ts
elizacloud-gateway-fallback.test.ts
elizacloud-server-error-retries.test.ts
final-audit-snippet.test.ts
final-audit-uncertain.test.ts
fix-verification.test.ts
fixed-issue-title.test.ts
git-commit-message.test.ts
git-commit-scan-cache.test.ts
git-conflict-resolution-prompts.test.ts
git-fetch-timeout-ms.test.ts
git-latent-merge-probe.test.ts
git-path-at-head.test.ts
git-push-auth-url.test.ts
github-api-errors.test.ts
github-api-parser.test.ts
has-conflict-markers.test.ts
IMPLEMENTATION_AUDIT.md
issue-analysis.test.ts
issue-comment-dedup.test.ts
lesson-forbid-path.test.ts
lessons-normalize.test.ts
lessons.test.ts
llm-issue-existence.test.ts
mark-verified-shortcircuit.test.ts
migration-journal-path.test.ts
model-catalog.test.ts
model-context-limits.test.ts
nested-conflict-chunks.test.ts
nested-conflict-markers.test.ts
non-actionable-comments.test.ts
normalize-lesson-text.test.ts
normalizeLessonText.direct.test.ts
normalizeLessonText.test.ts
openai-chat-content.test.ts
outdated-model-advice.test.ts
parse-result-code.test.ts
path-utils.test.ts
pill-parse-json.test.ts
pill-tool-repo-scope.test.ts
pluralize.test.ts
prr-runtime-meta.test.ts
README.md
reporter-aar.test.ts
resolve-tracked-path-pr-files.test.ts
review-body-normalize.test.ts
run-with-concurrency.test.ts
session-model-skip.test.ts
solvability-pr-comment.test.ts
thread-replies.test.ts
README.md

Test Framework

This directory contains the comprehensive test framework for PRR and related tools.

Structure

Unit Tests (tests/)

Existing unit tests for pure functions, parsers, formatters.

Integration Tests (tests/)

Subsystem tests with mocks (git ops, LLM client).

Evals (tests/evals/)

Evaluation framework for stochastic tools - measures actual performance with real LLMs.

  • benchmark/ - Golden datasets for each tool
  • runner/ - Eval execution engine
  • prr/, pill/, split-plan/, story/ - Tool-specific eval tests

See tests/evals/README.md for details.

Scenario Tests (tests/scenarios/)

Mock-based scenario tests for workflow correctness.

  • helpers/ - Assertions and workflow execution helpers
  • fixtures/ - Test repository fixtures
  • *.scenario.ts - Scenario test files

Test Utilities (tests/test-utils/)

Shared utilities for all tests.

  • github-mock.ts - Mock GitHub API
  • git-helpers.ts - Git repository setup
  • llm-mock.ts - Mock LLM client
  • scenario-builder.ts - Scenario construction

Deterministic Tool Tests

  • tests/split-rewrite-plan/ - Tests for split-rewrite-plan (git operations)
  • tests/split-exec/ - Tests for split-exec (git operations, PR creation)

Running Tests

# All tests
npm test

# Unit tests only
npm test -- tests/ --run

# Scenario tests
npm test -- tests/scenarios/ --run

# Evals (requires API keys)
npm run eval -- run -t prr -b simple-fix

Testing Strategy

  1. Unit tests (fast, deterministic): Pure functions, parsers, formatters
  2. Scenario tests (medium speed, mocked): Workflow integration with mocks
  3. Evals (slower, stochastic): Real tool runs on benchmark datasets with actual LLMs