Testing
The test layers of Seed Exact, what each one proves, where it runs, and what the app talks to while under test.

Seed Exact is tested in layers: Bun unit tests for the TypeScript in src/, Contract UI tests that drive the built app on web or an iOS simulator, a compatibility suite against the repository's real vault server, and Exact's verify for visual checks. Only the Bun side runs in GitHub Actions; everything that needs a built app runs on a developer machine or the build Mac.

The pyramid

Layer

Command (from frontend/apps/mobile-exact)

Where it runs

What it proves

What it cannot prove

Bun unit tests

bun run test

Laptop, CI, and the Clipper worker before every build

Package logic in Bun: parsing, Markdown, caches, signed bytes, vault store and merge, agents rows

Anything about Contract views, the Hermes turn budget, or native transport

Parity vectors

part of bun run test, plus crypto.test.contract

Laptop, CI; the Contract part in the host runtime

Bytes, signatures and CIDs match the original clients

That a server accepts them today

Worker unit tests

python3 tools/test_clipper_deploy.py

Laptop, CI

Ordering, skip and retry rules of the delivery worker

Signing, upload, App Store Connect

Contract UI tests

bun exact.mjs test web or test ios

Laptop (headless Chrome) or simulator. Not CI

Screens, navigation and data flow of the real app with a controlled clock

Pixels, text size, real time races

Real vault suite

REAL_VAULT=1 bun test ./.tests/real-vault/real-vault.test.ts

Laptop, CI

src/vault interoperates with the real vault server and its web UI

Native storage, Safari, passkeys

Real vault drives

bun .tests/real-vault/drive.ts ios, race.ts

Simulator (and web for drive.ts)

The built app completes a real browser approval, on real platform time in race.ts

Physical devices

Verify

bun exact.mjs verify, verify ios

Laptop or simulator. Not CI

All Contract tests plus light, dark and largest text checks and one relaunch

Behavior no test reaches

Counts at this commit: 23 Bun test files with 221 test( sites, 11 Contract test files with 67 tests, 9 real vault tests and 7 worker tests.

What talks to what

Exact starts one server per app for tests: app.json names it in commands.server as bun tools/test-server/index.ts (app.json). That local test server listens on 127.0.0.1:4790, mounts the notify and vault mocks, starts the agents mock on port 3068, and proxies read only document requests to hyper.media.

flowchart LR T["Contract test driver"] -->|"tap, type, clock"| A["App under test"] T -->|"request steps"| S["Test server 127.0.0.1:4790"] A -->|"server set to 4790"| S S --> N["mock-notify /activity/*"] S --> V["mock-vault /vault/*"] S -->|"/dev/* forwarded"| G["mock-agents 127.0.0.1:3068"] A -->|"signed CBOR and WebSocket"| G S -->|"GET /hm/* and /api/*"| H["hyper.media"] A -->|"read tests"| H A -->|"write tests, test vector key"| D["dev.hyper.media"] B["Bun tests"] -->|"handle called in process"| N B -->|"handle called in process"| V R["Real vault suite"] --> RV["Real vault server, temp SQLite"] R --> C["Chromium via Playwright"] C --> RV

Rules that hold across layers:

    No test writes to hyper.media. Writes go to dev.hyper.media with the public BIP-39 test vector identity, or to a local mock.

    The test server refuses any hosted notify path with 403, so a misrouted request cannot reach the real notify service.

    Each Contract test launches the app fresh with its own empty store.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Attributes
name
Testing
summary
The test layers of Seed Exact, what each one proves, where it runs, and what the app talks to while under test.