Testing
bash
pnpm typecheck # tsc --noEmit
pnpm test # 111 unit / integration tests (vitest)
pnpm build && pnpm test:e2e # 54 end-to-end tests (Playwright, production build, throw-away database)
pnpm secret-scan
pnpm test:all # everything aboveNo test touches the network or the production database. The forge is replaced by an in-process fake; the end-to-end server points its forge URL at a closed port.
| Suite | What it proves |
|---|---|
tests/catalog.test.ts |
Seed content is valid, bilingual and references existing files; no seeded app claims a public channel; filters, search (accent-insensitive), sorting; draft → publish workflow; no card gets a download or TestFlight action without a verified destination. |
tests/releases.test.ts |
Discovery of public repositories only; idempotence; retries; failing repository reported; stale flag; invalid releases (missing checksum, foreign URL, empty file, bad tag); approval → published; checksum mismatch; forge download error; notarization policy; default version and rollback; automatic withdrawal when the asset changes; download route (bytes, range, 404 for unapproved / unknown / traversal / unpublished / tampered); counters; audit trail. |
tests/testflight.test.ts |
Invitation URL rule; valid public invitation; missing; internal; disabled; full; unverified; wrong platform; link check parsing; no fetch to foreign hosts. |
tests/security.test.ts |
Enrolment tokens (hashed, single live, expiring, absent from logs); forged attestation refused; challenge single-use and bound to the browser; lock-out; session expiry and idle timeout; 401 on every admin route; CSRF and origin checks; draft/publish through the API; uploads (re-encoding, non-images and SVG refused, traversal); webhook signature, staleness, replay; rate limiting. |
tests/maps.test.ts |
Map distribution route (/maps/v1) on a throw-away directory: documents 200 / 304 with SHA-256 ETags, package 200, 206 with exact bytes, If-Range match and mismatch, 416, ignored multi-range, HEAD, unlisted file, size mismatch, symbolic link leaving the root, traversal and odd segments, pins.json, empty distribution, rate limit. |
tests/maps-library.test.ts |
Maps page library (src/lib/maps.ts) on throw-away directories: regions sorted by download size with names, sizes, data date, version, licences and components; unknown capabilities dropped; region document missing, malformed or of another version; malformed entries skipped; symbolic links leaving the root; same root as the /maps/v1 route; empty, missing or malformed catalogue is an empty library; decimal size units. |
e2e/public.spec.ts |
Homepage, universe interaction, reduced motion, catalog filters in the URL, all nine product pages, gallery keyboard navigation, byte-exact download of a fixture image, TestFlight states, comparison, French pages and hreflang, light/dark, 404, keyboard, sitemap/robots/metadata, security headers, no third-party request, axe WCAG 2.1 A/AA on ten page/appearance combinations. |
e2e/admin.spec.ts |
Closed without a session; invalid and reused enrolment links; passkey enrolment and sign-in with a virtual authenticator; CSRF; draft → preview → publish; invalid document refused; screenshot upload to public gallery; unverified TestFlight link never shown; release approval failing closed; withdrawal; sync error surfaced; announcements; audit trail. |
e2e/mobile.spec.ts |
Phone and tablet viewports: no horizontal overflow, navigation, touch selection in the universe, touch target sizes, responsive lazy images. |
Two fixture applications exist only in the end-to-end database, to exercise states production does not have yet (a published macOS image, an open public beta).
Not covered by automation: a real Touch ID / Face ID ceremony on the production domain, Safari and Firefox rendering, a real notarized DMG going through approval (none exists yet), a real public TestFlight page.