Skip to content

how to contribute testing

Douwe de Vries edited this page Jul 1, 2026 · 1 revision

Testing

Tests are colocated with the code they cover. Frontend tests use Vitest, jsdom, and Testing Library, while Rust tests live under backend modules such as src-tauri/src/importing/tests.rs and src-tauri/src/k6/tests.rs.

Commands

npm run lint
npm run typecheck
npm test
cd src-tauri && cargo test
cd src-tauri && cargo check

CI also runs npm run build, as shown in .github/workflows/ci.yml.

Frontend tests

Area Examples
App validation src/app/App.validation.test.tsx
Persistence src/app/persistence.test.ts, src/app/App.persistence.test.tsx
Import hook src/features/import/useCollectionImport.test.tsx
Test harness src/features/test/useTestHarness.test.tsx
Smoke test hook src/features/test/useSmokeTest.test.tsx
cURL parsing src/lib/curl.test.ts

src/test/setup.ts creates test globals and memory storage, including a guard against Node's nonstandard global localStorage.

Rust tests

Backend tests cover collection parsing, generated scripts, command validation, smoke tests, report export, summary parsing, k6 process behavior, and artifact cleanup. CI sets LOADRIFT_REQUIRE_BUNDLED_K6_TESTS=true so bundled-k6 regression tests cannot silently skip.

For state and event patterns used by tests, see Patterns and conventions.

Clone this wiki locally