Skip to content

Testing

Leonard Ramminger edited this page Aug 31, 2026 · 1 revision

Testing

Layout

  • Unit tests in #[cfg(test)] modules under src/
  • Integration tests in tests/
  • Grouped module tests in tests/modules/
  • System tests in tests/system_test.rs (install, load .pb, mock HTTP)

Strategies

Style Use when
MockApiClient (test-utils) No network; fast unit coverage
mockito Real HTTP stack with mocked endpoints
ffi_test C ABI integration (--test-threads 1)
wasm-pack test Browser or Node WASM bindings

Coverage

Target: 85% or higher via tarpaulin:

make coverage

CI runs coverage on every push to main and uses --test-threads 1 for integration tests.

Adding behavior

When adding a command or YAML field:

  1. Parser test
  2. Model validation test
  3. Client or integration test if user-visible

Clone this wiki locally