testing-reeflisted
Install: claude install-skill Blushyes/reef
# Testing in the reef workspace
A project-specific test playbook. Follow this when adding **any** test. The goal is that tests are deterministic across Linux/macOS CI and every dev's laptop, and that no test becomes that one flaky thing everyone reruns.
## Workspace layout (post-deplugin)
Reef is a single-process binary — there is no plugin subsystem. The repo root IS the `reef` crate; the workspace exists only to hang the test-fixture helper off it:
- **Root (`reef` crate)** — `src/` (app state, UI panels, git operations), `tests/` (integration), `benches/` (criterion).
- **`crates/test-support`** — shared fixtures (`tempdir_repo`, `commit_file`, `write_file`, `HomeGuard`).
- **`fuzz/`** — fuzz targets. Separate package, not in the workspace; run via `cargo +nightly fuzz run <target>`.
## Quick decision table
| Scenario | Test type | Where it goes |
|----------|-----------|---------------|
| Pure function, no I/O | Unit test | `#[cfg(test)] mod tests` inline at bottom of the source file |
| Uses `git2::Repository`, real fs | Integration test | `tests/<name>_integration.rs` |
| Algorithmic invariant over random inputs | Property test | `tests/<name>_properties.rs` (uses `proptest`) |
| Full UI rendered to terminal buffer | Snapshot | `tests/<name>_snapshots.rs` (uses `insta` + `ratatui::TestBackend`) |
| Hot-path performance | Benchmark | `benches/<name>.rs` (uses `criterion`) |
| Parser / deserializer robustness | Fuzz target | `fuzz/fuzz_targets/<name>.rs` |
If you'r