Skip to main content

Testing

Run all commands from the repository root unless noted.
Full suites and bun run check can take 10 minutes or more. Run them in the background (or a second terminal) rather than blocking your session, and prefer bun run test:chunked for the frontend suite: it runs in 5-file chunks with a 2 minute hard timeout each, so a hang is capped and the stuck files are named. Do not pipe a suite through tail; it buffers everything, so a hang looks like silence.

What CI runs

Run these before opening a PR.

Frontend (Vitest)

Node.js must be installed for the frontend tests.

Rust

The repo is a cargo workspace, so you can also target one member from the root:
Tests that touch settings state set ECHOPHRASE_CONFIG_DIR to a temp sandbox so they never read or write real user settings (see CONFIG_DIR_ENV in src-tauri/src/settings/mod.rs).

CLI crate

The CLI suite covers the pure audio helpers, path resolution (via ECHOPHRASE_HOME), session round-trips, the ops layer and integration tests that drive the real binary through transcode, the MCP server and transcribe. The transcribe tests stand up a fake local HTTP server in place of the desktop app. Tests that mutate the environment are serialized because ECHOPHRASE_HOME is process-global. See CLI and MCP internals.

Code quality

Audio fixtures and the hands-free E2E test

tests/audio/ holds fixture WAVs (for example test-1-2.wav) and its own notes in tests/audio/CLAUDE.md. On macOS you can verify the whole record -> transcribe -> paste pipeline with no human interaction, using the speakers as the audio source. See Audio pipeline.

Manual QA for the CLI transcribe path

The automated tests use a fake IPC server. To check the real path:
  1. Run bun run tauri:dev, enable Settings > MCP Server, and wait for the model to load.
  2. From cli/, run cargo run -- transcribe ../tests/audio/test-1-2.wav and confirm a transcript prints.
  3. Quit the app and run the same command again. It should print the friendly “desktop app must be running” error.