testing/app_server.ts view source
(options: CreateTestAccountWithCredentialsOptions): Promise<{ account: { id: string & $brand<"Uuid">; username: string; }; actor: { ...; }; api_token: string; session_cookie: string; }> import {bootstrap_test_keeper} from '@fuzdev/fuz_app/testing/app_server.js'; Bootstrap the test-DB keeper. Direct-query shortcut for the default
create_test_app path — bootstrap is not what most tests exercise, so
we skip the real bootstrap_account flow (no audit row, no
on_bootstrap callback). Tests that need the full success-path flow
use create_test_app_for_bootstrap instead.
Flips bootstrap_lock.bootstrapped = true so the post-insert DB state
matches a real bootstrap completion — production code can trust the
lock as the single signal without a belt-and-suspenders
query_account_has_any defense.
options
returns
Promise<{ account: { id: string & $brand<"Uuid">; username: string; }; actor: { id: string & $brand<"Uuid">; }; api_token: string; session_cookie: string; }>
mutates
the underlying options.db — inserts the account/actor/roles/— API token/session_cookie rows AND flips `bootstrap_lock.bootstrapped`.