Skip to main content

Unit tests

This runs the scripts that use bun:test, without needing a server. .github/workflows/tests.yml runs these on pushes and pull requests. It then checks password and two-factor concurrency, poll visibility, search operators, API request limits, email confirmations, data exports, scheduled threads and quotas, bookmark pagination, media privacy, chunked video uploads, account settings and encrypted chat, against a fresh PostgreSQL 18 database and a local server. The pinned client isn’t downloaded there; checks that need it report a skip.

Database-only checks

The test-*-concurrency.ts, test-poll-visibility.ts and test-search-operators.ts scripts can run against a dedicated, migrated test database without a server. Set DATABASE_URL to that database; each script creates and removes its own test accounts.

End-to-end scripts

scripts/test-*.ts check each feature against a running server, for example:
Each script’s first lines give its arguments. Set RATE_LIMITS=off on the server while running them. Others include test-account-settings, test-two-factor, test-password-reset, test-reply-limits, test-views, test-protected, test-communities, test-lists, test-polls and test-scheduled.
A passing script is not a working screen. Check the UI with drive.ts too.

Driving the real client

This clicks through the real client in headless Edge and takes screenshots. It uses the browser profile scripts/probe.sh leaves signed in.

Finding missing handlers

GET /_debug/unknown (admins only) lists the client calls no handler answers yet, most frequent first. Start there when a screen is empty. LOG_REQUESTS=1 logs every API call, and LOG_REQUESTS=errors also prints the client’s error reports.