Repository navigation
Testing
Run these before opening a pull request:
pnpm format:rust:fmt
pnpm check
pnpm test
pnpm build
pnpm lint:actions
pnpm lint:shell
pnpm audit:rust
pnpm audit:pnpmThe rest of this page covers the tools and suites behind these gates. Run the full test suite from the project root with pnpm test (UI, i18n, Rust, and Playwright browser tests). Use these commands for coverage or focused browser runs:
pnpm test:coverage
pnpm test:e2e
pnpm test:a11yThe combined coverage command runs UI tests with V8 coverage and the Rust workspace with cargo-llvm-cov. It writes an HTML report to coverage/index.html and an LCOV report to lcov.info, which is read by the recommended Coverage Gutters VS Code extension. Use pnpm test:ui:coverage or pnpm test:rust:coverage for a targeted coverage run. Rust tests, Clippy, and Tauri builds keep Cargo artifacts in a host-triple-specific directory under src-tauri/target, so macOS builds and dev-container builds do not share incompatible host artifacts.
pnpm lint and pnpm format:check are also available for a quick pass over the UI code.
The dev container installs the required Rust tools during setup. For a local setup, install them once:
rustup component add clippy rustfmt llvm-tools-preview
cargo install cargo-deny --locked
cargo install cargo-nextest --locked
cargo install cargo-llvm-cov --locked
cargo install cargo-audit --lockedcargo-deny is required by pnpm check; cargo-nextest is required by pnpm test:rust; cargo-audit is required by pnpm audit:rust; and cargo-llvm-cov plus llvm-tools-preview are required for Rust coverage. pnpm lint:actions requires actionlint, and pnpm lint:shell requires shellcheck; both are installed in the dev container. For local setup, follow the actionlint installation instructions and the shellcheck installation instructions.
Lint levels live in [workspace.lints] in src-tauri/Cargo.toml. Tests are exempted from the panic and printing rules via src-tauri/clippy.toml.
pnpm test:integration runs tests/**/*.integration.test.ts, which need external tools that the unit suites do not require. It is excluded from pnpm test:ui and coverage. It currently needs PowerShell 7 (pwsh) to run the Windows WebView2 record round-trip. Install PowerShell before running it, then run:
pnpm test:integrationRun only the Playwright suite with pnpm test:e2e, or its focused accessibility selection with pnpm test:a11y:
pnpm test:e2e
pnpm test:a11yThe tests use synthetic IPC, event, and clipboard fixtures and reject unexpected external requests. Never add real or realistic clinical data to a browser fixture. If Chromium is not installed locally, run pnpm exec playwright install chromium. Browser mocks verify UI behavior, not native Rust policy enforcement, updater signatures, or platform installation.
CI runs these checks, defined in GitHub Actions and GitHub Actions:
- Workflow linting (
actionlint) and shell linting (pnpm lint:shell) in the release quality checks. -
pnpm test:integrationin the "UI and i18n" job, after the UI and i18n tests, with PowerShell installed.
pnpm lint:actions remains available for local use.
Epikrise wiki
Using Epikrise
Developing
Maintaining