The Bun suite checks the TypeScript packages under src/ and the combined test server without building the app. It is the only app test layer that runs in GitHub Actions, and the Clipper worker runs it again before each TestFlight build.
Command
bun install --frozen-lockfile
bun run test # package.json: "bun test src tools/test-server"The script is defined in package.json. Bun is pinned to 1.4.2 by packageManager. Root level pnpm mobile:test wraps the same script. The real vault suite lives in .tests/ and is not matched by this command, see Real vault compatibility suite.
Test files
Counts are test( call sites in the file at this commit. Where a site sits inside a loop over a fixture, the number of tests Bun reports is higher; this is noted per file. The suite was not executed for this page.
File | Package | Tests | Covers |
|---|---|---|---|
activity | 17 | Notify URL discovery, redirect refusal, signed request bytes, the ±20 s window against the mock, inbox grouping and read state, email verification states | |
agents | 12 | Envelope bytes equal to the React Native vector, URL normalisation and both endpoint layouts, secrets kept off remote plain HTTP, transcript replay, plans, token formatting, model choices | |
agents | 11 | Child runs by plan step, tool spawns, source chips, trigger context, structured parts, provider submissions (loops over provider types inside one test), fresh read clocks, stale HTTP tree versus stream | |
agents | 6 | Request timestamps, non CBOR errors, non JSON frames, a source scan that forbids importing | |
crypto | 29 sites, 47 run (inferred) | Parity with the original clients: mnemonics (4 vectors, used by two loops), keys (6), comments (6), agents envelopes (2), vault states (2), plus changes, refs, profiles, notify bodies, seedkey files, HKDF, AEAD, envelopes, UUIDs | |
crypto | 3 | Explicit clocks: fractional milliseconds truncate, integer | |
crypto | 1 | Runs | |
discuss | 6 | Refresh discards late results, reply parents from another document are refused before signing, corrupt key refusal, versions sent with a nested reply | |
discuss | 6 | Summary counts on a captured home, thread ordering and nesting, reply targets, ids and Markdown | |
identity | 12 | Derivation vectors, the | |
identity | 4 | Unreadable bundles are never overwritten, malformed seeds refused without echoing key material | |
me | 11 |
| |
me | 6 | Import normalisation, idempotent reimport, concurrent imports, removal picks a valid current identity, request deadlines | |
profile | 9 sites, 10 run | History heads and depth, prefill, refusals before any request, signed publish for a new and an existing profile (loop over | |
read | 4 | Author face piles, comment counts, Query block style | |
read | 4 | The superjson decoder, including prototype pollution paths | |
read | 7 | Route parameters that are whole URLs, site versus gateway URLs, typed sites read from their own server | |
read | 11 | Crossing inline marks, injection through block text, link encoding, active URL schemes | |
read | 7 | Refresh epochs per server, redirects and redirect cycles, retryable failures | |
read | 21 | Ids, inline Markdown, blocks to rows on captured documents, query and directory lists, dates | |
read | 2 | Typed site URL normalisation and refusals (each loops over inputs inside one test) | |
vault | 27 |
| |
test server | 5 | Proxy Host header, CORS, the 403 for hosted notify paths, see The local test server |
Total: 221 sites, about 240 tests when the loops expand (inferred from the fixture lengths, not from a run).
Fixtures
Fixture | Source |
|---|---|
| Written by |
| Written by tools/mock-agents/generate-vector.ts, which slices |
| Real |
| A captured comment listing of the hyper.media home (test name: "the live hyper.media home") |
Conventions
Tests live in src/<pkg>/__tests__/*.test.ts and import bun:test.
Secret storage is an in memory Map with get, set, forget, matching the SecretStore shape of Identity.
Network is replaced per test: spyOn(globalThis, 'fetch'), a swapped globalThis.fetch restored in afterEach, or a mock's handle(req) called in process. Activity tests start the notify mock with Bun.serve on port 0.
Clocks are passed in explicitly (NOW, now) wherever the code under test takes a time argument.
One test needs the network: the first case in routes.test.ts proxies a real document read to hyper.media.
Related
Mock notify service and Mock vault, both called in process by this suite
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime