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 toolrunner/- Eval execution engineprr/,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 helpersfixtures/- Test repository fixtures*.scenario.ts- Scenario test files
Test Utilities (tests/test-utils/)
Shared utilities for all tests.
github-mock.ts- Mock GitHub APIgit-helpers.ts- Git repository setupllm-mock.ts- Mock LLM clientscenario-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
- Unit tests (fast, deterministic): Pure functions, parsers, formatters
- Scenario tests (medium speed, mocked): Workflow integration with mocks
- Evals (slower, stochastic): Real tool runs on benchmark datasets with actual LLMs