Skip to content

how to contribute testing

factory-droid[bot] edited this page Jul 5, 2026 · 1 revision

Testing

QA Scribe has frontend unit/workflow tests, Rust unit and integration tests, Tauri command tests, packaging tests, and a non-GUI smoke harness. The script names are in package.json.

Test commands

Command Scope
bun run frontend:test Vitest tests in frontend/src, with jsdom setup from frontend/vite.config.ts.
cargo test --workspace Rust core, Tauri, and smoke-harness tests.
bun run test Frontend tests, frontend dist guard, and Rust workspace tests.
bun run smoke cargo run -p qa-scribe-app, which runs the non-GUI smoke workflow.
bun run verify Full verification gate, including audit, bindings, build, clippy, tests, and smoke.

Frontend patterns

frontend/src/test/fixtures.ts stores shared fixtures. frontend/src/test/dialogPolyfill.ts provides dialog support for jsdom tests. frontend/src/App.test.tsx exercises full app workflows, while targeted tests under frontend/src/app and frontend/src/editor cover autosave, generation reconciliation, attachments, sanitizer behavior, and copy workflows.

Rust patterns

Core storage tests live under crates/qa-scribe-core/tests/session_storage. They cover lifecycle operations, validation, rich body JSON round trips, attachment integrity, migrations, schema-version rejection, AI run lifecycle, generation contexts, drafts, evidence links, cascades, and cross-session validation.

Tauri-side tests cover command error mapping, state wrappers, job lifecycle, provider detection, process streaming, watchdog timeout, cancellation, and binding drift. See src-tauri/src/commands/ai/streaming_exec/tests.rs, src-tauri/src/commands/providers/tests, and src-tauri/src/specta_bindings.rs.

When to run what

Use scoped tests while developing. Before a change is ready, run bun run verify:fast for most code changes. Run bun run verify before release-sensitive changes or broad changes that touch Rust, frontend, bindings, and packaging together.

Clone this wiki locally