docs(claude): document the new unit-test layers and commands
CLAUDE.md claimed the Playwright smoke tests were the only tests; add the Vitest and cargo-test commands and describe the three test layers, including the shared db::test_support fixture for DB-touching Rust tests.
This commit is contained in:
@@ -27,6 +27,13 @@ pnpm build:app:cuda
|
|||||||
# Type-check frontend
|
# Type-check frontend
|
||||||
pnpm build:vite
|
pnpm build:vite
|
||||||
|
|
||||||
|
# Frontend unit tests (Vitest; only picks up src/**/*.test.ts)
|
||||||
|
pnpm test:unit
|
||||||
|
pnpm test:unit:watch
|
||||||
|
|
||||||
|
# Rust unit tests (in-memory SQLite; --no-default-features skips CUDA)
|
||||||
|
pnpm test:rust
|
||||||
|
|
||||||
# E2E tests (Playwright against the UI Lab; auto-starts the server)
|
# E2E tests (Playwright against the UI Lab; auto-starts the server)
|
||||||
pnpm test:e2e
|
pnpm test:e2e
|
||||||
pnpm exec playwright test tests/ui-lab.spec.ts # single file
|
pnpm exec playwright test tests/ui-lab.spec.ts # single file
|
||||||
@@ -38,7 +45,10 @@ pnpm format:all
|
|||||||
|
|
||||||
Use **pnpm** — never npm.
|
Use **pnpm** — never npm.
|
||||||
|
|
||||||
The only tests are the Playwright e2e smoke tests in `tests/`, which run against the UI Lab (browser mocks), not the real Tauri app. There are no unit tests.
|
Three test layers, none of which exercise the real Tauri window:
|
||||||
|
- **Vitest unit tests** — co-located `*.test.ts` next to the pure logic they cover (`src/store/helpers.ts`, formatters, path utils); fixture factories in `src/test/factories.ts`.
|
||||||
|
- **Rust unit tests** — inline `#[cfg(test)]` modules; DB tests run against in-memory SQLite via the shared `db::test_support` fixture (`test_conn()` + `test_image()`), which registers sqlite-vec and applies both migrations. Reuse it for any new DB-touching tests.
|
||||||
|
- **Playwright e2e smoke tests** in `tests/` — run against the UI Lab (browser mocks).
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user