| What | Command |
|---|---|
| All tests (Rust + Frontend) | make test |
| Frontend only | pnpm test:unit |
| Frontend watch mode | pnpm test:watch |
| Frontend with coverage | pnpm test:coverage |
| Rust only | make test-backend |
| Specific frontend test | pnpm test:unit <pattern> |
| Specific Rust test | cd src-tauri && cargo test <name> |
Stack: Vitest + React Testing Library
Location: src/**/*.{test,spec}.{ts,tsx}
Setup: src/test-utils/setup.ts
Example:
# Run tests matching "QueryPanel"
pnpm test:unit QueryPanel
# Watch mode for a specific file
pnpm test:watch src/components/QueryPanelUnit tests: src-tauri/src/**/*.rs (inline #[cfg(test)] modules)
Integration tests: src-tauri/tests/
Example:
cd src-tauri
# Run a specific test function
cargo test test_connection
# Run a specific integration test file
cargo test --test integration_test_nameDocker Compose provides test databases:
# Start containers and seed all databases
make setup
# Or step by step:
make docker-up # Start containers
make seed-all # Seed all databases
make seed-postgres # Seed PostgreSQL only
make seed-mysql # Seed MySQL onlyTest Databases (via make setup):
- PostgreSQL:
localhost:15432 - MySQL:
localhost:13306 - SQLite:
seeds/sqlite/query_pilot_test.db - SQL Server:
localhost:11435 - Oracle:
localhost:11521
See Dev Database Setup for credentials.
Requires Docker:
make test-ssh-fullAfter React/TypeScript changes:
pnpm typecheck && pnpm lintAfter Rust changes:
cd src-tauri && cargo clippyBefore committing:
pnpm lint && pnpm typecheck && make test