Testing Strategy & QA
Relevant source files
The following files were used as context for generating this wiki page:
Termul employs a multi-layered testing strategy to ensure reliability across its Tauri desktop application, web client, and standalone server. The quality assurance process combines automated unit testing, end-to-end (E2E) verification, cross-surface parity checks, and strict CI/CD gates for pull requests.
The strategy prioritizes "Parity Coverage" to ensure that features function identically whether running in a native Rust/Tauri context or a browser-based environment. Developers must run bun run test, bun run typecheck, and bun run lint before submitting changes. Sources: CONTRIBUTING.md:46-55, AGENTS.md:31-34
Automated Test Suites
The project categorizes automated tests into distinct domains based on the technology stack and runtime environment.
Unit & Integration Testing
Frontend logic, Zustand stores, and React components are tested using Vitest. Test files are co-located next to the code they test, following the component.test.tsx naming convention. For the Rust backend, unit tests are placed in sibling files named <name>_tests.rs or <name>/tests.rs rather than inline modules. Sources: CONTRIBUTING.md:120-123, AGENTS.md:42-43
Cross-Surface Parity Checklist
A specialized test suite, parity-checklist.test.ts, automatically verifies that critical domains are implemented for both Tauri and Web runtimes. This prevents regressions where the application might incorrectly fall back to legacy implementations or fail in non-secure browser contexts. Sources: src/renderer/lib/tests/parity-checklist.test.ts:1-20
The checklist ensures that both Tauri adapters (e.g., tauri-terminal-api.ts) and Web adapters (e.g., web-terminal-api.ts) expose identical typed facades. Sources: src/renderer/lib/tests/parity-checklist.test.ts:200-225
Landing Page & SEO Verification
The landing page uses bun test for API helpers and Playwright for E2E testing. A custom verify:prerender script checks the production build output (dist/index.html) to ensure that static SEO content is correctly rendered by vite-plugin-react-ssg. Sources: landing/package.json:13-18, landing/README.md:104-108
CI/CD and Quality Gates
Termul enforces strict requirements for code submission to maintain high quality and consistency.
Pull Request Validation
Every PR description is validated against a required template. A custom script, validate-pr-body.ts, parses the PR body to ensure specific sections are populated and valid. Sources: scripts/validate-pr-body.ts:1-15
| Section | Requirement |
|---|---|
| Summary | Explains "what" and "why" of the change. |
| Related Issue | Must link a "Closes #" or explain why no issue exists. |
| Type of Change | At least one checkbox must be checked (feat, fix, etc.). |
| What Changed | List of concrete code changes. |
| How It Was Tested | Evidence of verification (unit tests or manual). |
| Sources: scripts/validate-pr-body.ts:75-125 |
Linting & Formatting
The project uses Biome for linting and formatting. Strict rules are enforced, such as noRestrictedImports which prevents importing Tauri APIs directly into UI components; they must be accessed via the src/renderer/lib/ facades. Sources: biome.json:44-54
API Bridge & Persistence Testing
The api-bridge.test.ts ensures that the unified API singleton correctly routes calls to the appropriate runtime implementation. This prevents silent fallbacks to unavailable APIs (like Electron's window.api) in a Tauri environment. Sources: src/renderer/lib/tests/api-bridge.test.ts:200-220
Key persistence tests verify:
- Session Data: Integrity of terminal history and workspace state during save/restore cycles. Sources: src/renderer/lib/tests/tauri-session-api.test.ts:430-475
- Persistence Store: Versioned data handling and debounce logic for
writeDebouncedoperations to optimize disk I/O. Sources: src/renderer/lib/tests/tauri-persistence-api.test.ts:160-185 - Data Migration: Execution of schema migrations and rollback capabilities. Sources: src/renderer/lib/tests/api-bridge.test.ts:245-260
Manual Quality Assurance
Manual verification is required for UI changes. For mobile web shell changes, QA focuses on the "44px hit floor" for touch targets and ensuring text remains readable (≥12px) on mobile viewports. Sources: CONTRIBUTING.md:52-53, src/renderer/components/git/GitPanel.mobile.test.tsx:110-125
Termul's testing strategy ensures that technical boundaries defined in AGENTS.md are strictly maintained, particularly the isolation of native behavior in Rust/Tauri from the runtime-neutral React renderer. Sources: AGENTS.md:21-25