Core Concepts
Architecture
Understand Repterm's layered architecture and end-to-end test execution flow.
Layered Design
Repterm follows a four-layer architecture, with each layer having clear responsibilities:
CLI
→ Runner
→ API
→ TerminalCLI Layer
Parses command-line arguments, orchestrates the test run, and reports results. Includes the reporter for streaming output and the plugin manager CLI.
Runner Layer
Handles test discovery, filtering, execution scheduling, and artifact management. Supports both single-worker and multi-worker parallel execution.
API Layer
Provides the test DSL (test, describe, expect, hooks) and the plugin system (definePlugin, defineConfig, createTestWithPlugins).
Terminal Layer
Manages terminal sessions, the $ tagged template for command execution, recording with asciinema/tmux, and shell integration (OSC 133 prompt detection).
Key Dependencies
- CLI calls Loader, Filter, Runner, and Scheduler
- Runner calls Hooks, Terminal, Artifacts, and Reporter
- Terminal uses Dollar (
$), Session, Recorder, and ShellIntegration - Plugin system feeds into Test API → Runner (with lifecycle hooks)
End-to-End Flow
- CLI parses args →
discoverTests(paths)→loadTestFiles(files)→ Registry registers suites and tests filterSuites(allSuites, recordMode)applies the--recordfilter- Single worker:
runAllSuites(...)/ Multi worker:createScheduler(...).run(...) - Runner notifies Reporter (
onTestStart→onTestResult→onRunComplete) - Runner creates a Terminal per test (choosing recording, PTY-only, or spawn mode)
- Lifecycle per test:
beforeEach→ test function →afterEach