-
-
Notifications
You must be signed in to change notification settings - Fork 3
testing policy
github-actions[bot] edited this page Oct 3, 2026
·
1 revision
Status: shipped.
- A new feature needs tests in the same pull request.
- A bug fix needs a regression test. The test must fail before the fix and pass after it. Say in the PR how you saw it fail.
- Every pure module has unit tests. In TypeScript, a module in
src/ui/liborsrc/ui/sharedneeds a sibling.test.tsfile.scripts/check-tested.shfails if it is missing. - Coverage only goes up. The ratchet values are in
.github/workflows/ci.ymlandpackage.json. Raise them when coverage rises. Never lower them. See Coverage. - A change to the no-leak design needs a test too. The architecture test and the leak test must stay green. See Leak test.
- Add no coverage exclusion and no skipped test.
Tests validate the requirements of the product owner (PO). They do not validate the code.
- The agent that writes the tests is not the agent that writes the code.
- The test writer gets only the requirement and the public interface. The requirement is the issue, the ADR, a
docs/wikipage or the IPC contract. The public interface is the function signatures, the IPC commands, the events and the UI. - The test writer does not read the implementation. It does not care how the code works.
- Each test names the requirement it checks. Use a link to the doc, or write the requirement text in the test name or in a comment.
- These tests are not allowed: a test that copies constants from the code, a test that asserts private state, a test that calls internal helpers, and a test that snapshots whatever the code prints today.
- When the code and the test disagree, the requirement decides. Never edit a test to match the code, unless the PO approves a change to the requirement first.
The flow:
- Write down the requirement.
- A blind test writer writes the tests from the requirement and the public interface.
- The tests fail.
- The implementer makes them pass.
- Refactor with the tests green.
npm ci
npm run build
cargo test --manifest-path src-tauri/Cargo.toml --locked
npm test
npm run test:coverage-
cargo testruns the Rust unit tests and the integration tests. -
npm testruns the TypeScript unit tests with the Node test runner. -
npm run test:coveragechecks the TypeScript coverage thresholds. - For Rust coverage, run
cargo llvm-cov --all-targets --summary-onlyinsrc-tauri. - The full set of checks also runs in CI on Linux, macOS and Windows.
- Today the Rust coverage floor is 0, because the first Rust tests arrive with the browser shell. Raise it in that PR.
- DOM glue outside
src/ui/libandsrc/ui/sharedis not covered.
- 2026-10-03 — Add the testing policy — #30.
Generated from docs/wiki in the repository. Edit there, not here.