06 - Testing Guide#
Helmor uses a multi-layer testing strategy. Each tier has its own framework, and a combined command runs everything.
Quick reference#
bun run test # All layers
bun run test:frontend # Frontend only (Vitest)
bun run test:sidecar # Sidecar only (Bun test)
bun run test:rust # Backend only (Cargo test)
bun run test:e2e # End-to-end (Playwright, WebKit)
bun run test:frontend:watch # Frontend watch mode
bun run test:rust:update-snapshots # Update Rust Insta snapshots
Frontend tests#
| Detail | Value |
|---|---|
| Framework | Vitest 4.1 with jsdom |
| Utilities | @testing-library/react |
| Test files | ~126 |
| Location | Co-located with source (*.test.ts, *.test.tsx) |
Frontend tests cover component rendering, hook behavior, state management logic, and query key generation. Mock Tauri's invoke for backend calls.
Sidecar tests#
| Detail | Value |
|---|---|
| Framework | Bun test (built-in) |
| Test files | ~11 |
| Location | sidecar/**/*.test.ts |
Sidecar tests validate protocol parsing, provider adapters, and event serialization.
Rust backend tests#
| Detail | Value |
|---|---|
| Framework | Cargo test |
| Snapshot testing | Insta (YAML format) |
| Test files | ~12 |
| Location | src-tauri/src/**/*.rs (inline #[cfg(test)] modules) |
Backend tests focus on database operations, workspace lifecycle, Git helpers, and pipeline transformations. Insta snapshots capture expected outputs — run bun run test:rust:update-snapshots after intentional changes.
End-to-end tests#
| Detail | Value |
|---|---|
| Framework | Playwright 1.59 |
| Browser | WebKit only |
| Spec files | 3 |
| Location | e2e/ |
E2E tests exercise the full app from UI interaction through backend and sidecar.
Writing new tests#
- Place test files next to the code they test.
- For frontend: use
@testing-library/reactand mock IPC boundaries. - For Rust: use inline
#[cfg(test)]modules with Insta snapshots for complex outputs. - For sidecar: test protocol and adapter logic in isolation.
Related#
- Local Development Setup — full dev environment commands.