-
Notifications
You must be signed in to change notification settings - Fork 1
how to contribute testing
khanhthanhdev edited this page Jun 1, 2026
·
1 revision
The Rust codebase contains 147 test functions spread across 17 source files. The heaviest concentration is in src/infra/db/mod.rs (39 tests), covering database roundtrips, analysis lifecycle, progress events, and freshness computation.
| File | Tests |
|---|---|
src/infra/db/mod.rs |
39 |
src/commands/mod.rs |
16 |
src/infra/acp/analysis_mcp_server/tool.rs |
15 |
src/prompts.rs |
11 |
src/infra/csv_parser.rs |
11 |
src/infra/acp/agent_discovery.rs |
9 |
src/domain/analysis.rs |
9 |
src/infra/sources/providers/finviz.rs |
8 |
src/domain/freshness.rs |
7 |
| Other files (8 files) | 22 |
cargo test- Tests live in
#[cfg(test)] mod testsblocks near the code they test. - Database tests use temporary directories via
tempfileoropen_atwith in-memory paths — they never touch the user's app data directory. - Tests are deterministic and do not depend on external network services.
The frontend uses Vitest with the happy-dom environment for unit testing.
-
frontend/src/features/report-viewer/projection-format.test.ts— projection formatting logic -
frontend/src/hooks/useQueryInvalidation.test.ts— TanStack Query invalidation hooks -
frontend/src/lib/markdown-highlights.test.tsx— markdown number highlighting
cd frontend && bun run testThis runs vitest run (single pass, no watch mode).
- Place test files adjacent to the code they test with a
.test.tsor.test.tsxsuffix. - Use
@testing-library/reactfor component tests and@testing-library/jest-domfor DOM assertions. - The happy-dom environment is configured in
frontend/vitest.config.ts.
-
No E2E test runner is configured yet. UI changes should be validated with
cd frontend && bun run build(type-check) and a manualcargo runsmoke test. - No frontend test coverage reporting is set up.
- No integration tests for the Tauri IPC layer.
- How to Contribute — definition of done
- Development Workflow — validation commands
- Tooling — build system and CI
- Patterns and Conventions — coding style