testing/cross_backend/setup.ts

Per-test fixture protocol shared by in-process and cross-process transports.

Each standard suite body takes a required setup_test: () => Promise<TestFixture> callback and invokes it once per test. The fixture carries everything a test needs to fire requests and assert on a single bootstrapped keeper account — transport, account / actor identity, three header builders, a multi-account mint factory, and (in-process only) the in-memory keyring + raw backend.

The cross-process producer default_cross_process_setup lives here, alongside the spawn-a-backend transport plumbing — it implements the SetupTest contract by spawning a binary and bootstrapping over real HTTP. The in-process producers (default_in_process_setup / default_in_process_suite_options, which wrap create_test_app) live in the sibling in_process_setup.ts so this module — and the cross-process consumers that import it — stay free of the in-process Hono app and its optional hono peer dependency.

view source

Declarations
#

21 declarations

BootstrappedBackendHandle
#

testing/cross_backend/setup.ts view source

BootstrappedBackendHandle import type {BootstrappedBackendHandle} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Cross-process backend handle enriched with the bootstrapped keeper's captured credentials. Consumers compose this in vitest's globalSetup:

const handle = await spawn_backend(config); const keeper_transport = create_fetch_transport({base_url: config.base_url}); const keeper = await bootstrap({transport: keeper_transport, config}); const bootstrapped: BootstrappedBackendHandle = { ...handle, keeper_transport, keeper_daemon_transport: create_fetch_transport({ base_url: config.base_url, initial_cookies: keeper.cookies, origin: null, }), keeper_account: keeper.account, keeper_actor: keeper.actor, keeper_cookies: keeper.cookies, };

default_cross_process_setup(bootstrapped, options) reads from this shape — the per-test fixture closes over the keeper credentials so cross-process tests can drive admin-RPC / audit-observer flows against the long-lived bootstrapped admin alongside the per-test signup+login account.

inheritance

extends: BackendHandle

keeper_transport

Transport carrying the keeper session cookie + cookie jar.

type (url: string, init: RequestInit): Promise<Response>

readonly

url

type string

init

type RequestInit
returns Promise<Response>

keeper_daemon_transport

Daemon-token transport for the keeper — same cookie jar as keeper_transport but with origin: null so it sends no Origin header. The daemon-token middleware discards the credential in a browser context (any Origin / Referer), so the _testing_* daemon-token calls (_testing_reset / _testing_schema_snapshot / _testing_action_manifest / _testing_mint_session) must route through this Origin-free transport. CSRF/cookie-session calls (invite_create, role_grant_offer_create) stay on keeper_transport, which keeps its default Origin.

type (url: string, init: RequestInit): Promise<Response>

readonly

url

type string

init

type RequestInit
returns Promise<Response>

keeper_account

Keeper account JSON captured from POST /bootstrap.

type { readonly id: Branded<string, "Uuid">; readonly username: string; }

readonly

keeper_actor

Keeper actor JSON captured from POST /bootstrap.

type { readonly id: Branded<string, "Uuid">; }

readonly

keeper_cookies

Raw keeper Set-Cookie values — thread into ws_transport for keeper-authenticated WS upgrades.

type readonly string[]

readonly

CapabilityGatedCrossSuiteOptions
#

testing/cross_backend/setup.ts view source

CapabilityGatedCrossSuiteOptions import type {CapabilityGatedCrossSuiteOptions} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

CrossSuiteOptions for a suite that reads capability flags — the ones whose cases are test_if-gated on a per-backend declaration. The field is on this variant rather than the base so a suite's option type states whether it consults capabilities: a caller cannot pass a flag bundle to a suite that ignores it, and a suite cannot quietly stop reading one while still demanding it.

inheritance

capabilities

Backend capability declarations — each suite gates on its own flag.

type BackendCapabilities

readonly

capture_action_manifest
#

testing/cross_backend/setup.ts view source

(handle: ReconstructedBootstrappedBackendHandle): Promise<{ methods: { method: string; input: "object" | "void"; side_effects: boolean; account: "optional" | ... 1 more ... | "required"; actor: "optional" | ... 1 more ... | "required"; roles: string[]; credential_types: string[]; rate_limit: "both" | ... 2 more ... | null; }[]; }> import {capture_action_manifest} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Capture a backend's live RPC action manifest over the _testing_action_manifest RPC action (keeper daemon-token channel). The action-surface twin of capture_schema_snapshot — pair two calls with assert_action_manifests_equal (testing/cross_backend/action_manifest_parity.ts) to gate that the TS spine and the Rust testing_spine_stub mount the same method set with the same per-method auth shape. Each impl answers from its own live registry (TS via build_action_manifest, Rust via the fuz_testing mirror); the normalized shapes match by design.

handle

returns

Promise<ActionManifest>

capture_migration_tracker
#

testing/cross_backend/setup.ts view source

(handle: ReconstructedBootstrappedBackendHandle): Promise<{ entries: { namespace: string; name: string; sequence: number; }[]; }> import {capture_migration_tracker} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Capture a backend's schema_version migration tracker over the _testing_migration_tracker RPC action (keeper daemon-token channel). The provenance twin of capture_schema_snapshot — where that reads the resulting schema (and excludes the tracker), this reads the tracker rows themselves. Pair two calls with assert_migration_trackers_equal (testing/schema_parity.ts) to gate that the TS spine and the Rust testing_spine_stub record byte-identical migration identity (namespace + name + sequence) — the invariant the schema-snapshot gate is blind to.

handle

returns

Promise<MigrationTracker>

capture_schema_snapshot
#

testing/cross_backend/setup.ts view source

(handle: ReconstructedBootstrappedBackendHandle, options?: { exclude_tables?: readonly string[] | undefined; }): Promise<{ tables: Record<string, { columns: Record<...>; indexes: { ...; }[]; constraints: { ...; }[]; }>; sequences: Record<...>; enums: Record<...>; }> import {capture_schema_snapshot} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Capture a backend's schema snapshot over the _testing_schema_snapshot RPC action (keeper daemon-token channel). The canonical way for a cross-impl parity gate to read each backend's live schema — pair two calls with assert_schema_snapshots_equal (testing/schema_parity.ts).

exclude_tables drops documented divergences from both sides before comparison (e.g. a cell-primary Rust backend lacks tables the TS schema has). Each impl answers from its own introspection — TS via query_schema_snapshot, Rust via fuz_db::query_schema_snapshot — and the snapshot shapes match by design.

handle

options?

type { exclude_tables?: readonly string[] | undefined; }
optional default {}

returns

Promise<SchemaSnapshot>

CreateTestAccountOptions
#

testing/cross_backend/setup.ts view source

CreateTestAccountOptions import type {CreateTestAccountOptions} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Options for TestFixture.create_account — mints an additional bootstrapped account alongside the keeper. Matches the existing TestApp.create_account signature so the migration to fixture-style reads is a one-site call rewrite per use.

username?

type string

readonly

password_value?

type string

readonly

roles?

type string[]

readonly

email?

Optional email to store on the account, exercising the username-or-email login lookup. Cross-process this rides the production signup body (claimed against the username-scoped invite, which matches regardless of the email); in-process it lands directly on the inserted row. Must be a valid Email (the cross-process signup validates it) and unique per test (the LOWER(email) partial-unique index rejects collisions).

type string

readonly

CrossProcessSetupOptions
#

testing/cross_backend/setup.ts view source

CrossProcessSetupOptions import type {CrossProcessSetupOptions} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

extra_keeper_roles?

Additional roles to grant the fresh keeper on every per-test reset, *in addition to* the [ROLE_KEEPER, ROLE_ADMIN] defaults the _testing_reset action seeds. Cross-process mirror of in-process extra_keeper_roles on default_in_process_suite_options.

Costs nothing extra per test — the _testing_reset action seeds the keeper in a single transaction regardless of how many roles are in the list.

ROLE_ADMIN is already in the default set, so admin-suite consumers usually pass an empty / omitted array. Consumer-defined roles (e.g. teacher) are passed here when the keeper-acting test needs them.

Keeper ≠ admin. Tests that need a *non-admin* secondary account with ROLE_KEEPER declare it via extra_accounts — ROLE_KEEPER's RoleSpec.grant_paths is bootstrap-only, so it can only be granted at the test-binary bootstrap-equivalent step.

type readonly string[]

readonly

extra_accounts?

Bootstrap-time secondary accounts seeded alongside the keeper on every per-test reset. See ExtraAccountSpec for why this is a cradle-only bypass. The reset action seeds them in the same transaction as the keeper.

type readonly ExtraAccountSpec[]

readonly

extra_actors?

Additional actor names to seed on the keeper account, beyond its single bootstrap actor — exposed on fixture.extra_actors. Declare to put the keeper into a multi-actor state so the actor_required / explicit-acting branches are reachable cross-process. See TestFixture.extra_actors.

type readonly string[]

readonly

reject_unknown_audit_metadata_keys?

Hold every audit row the fixture's readers parse to a closed world: metadata keys its event type doesn't declare are refused, not just mistyped or missing ones (assert_audit_event_metadata's reject_unknown_keys). Off by default, since the builtin schemas are open for consumer-added fields; a backend's own spine suite turns it on so neither spine can add an undeclared key. Exposed on fixture.reject_unknown_audit_metadata_keys.

type boolean

readonly

signup_path?

REST signup route fixture.create_account mints through. Default SPINE_ACCOUNT_SIGNUP_PATH; set it for a backend mounting the account routes under another prefix.

type string

readonly

login_path?

REST login route fixture.create_account logs in through. Default SPINE_ACCOUNT_LOGIN_PATH.

type string

readonly

CrossSuiteOptions
#

testing/cross_backend/setup.ts view source

CrossSuiteOptions import type {CrossSuiteOptions} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Base options shared by every imperative cross-backend parity suite (origin / ready / body_size / cell_* / actor_* / account_lifecycle / app_settings / testing_backdoor / …). The setup_test core is identical across them; each suite extends this with its own path field (rpc_path for RPC-dispatched suites via RpcPathCrossSuiteOptions, ready_path for the readiness probe, etc.), and a suite that actually gates cases on a capability flag extends CapabilityGatedCrossSuiteOptions instead. Lives here in the neutral fixture-types home rather than in any one domain helper, so a non-cell suite never reaches into the cell helpers for its option shape.

setup_test

Per-test fixture-producing function (fresh keeper + db per call).

type (): Promise<TestFixture>

readonly
returns Promise<TestFixture>

default_cross_process_setup
#

testing/cross_backend/setup.ts view source

(handle: ReconstructedBootstrappedBackendHandle, options?: CrossProcessSetupOptions | undefined): SetupTest import {default_cross_process_setup} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Build a SetupTest against a spawned + bootstrapped backend.

Per-test body (unconditional reset — fresh keeper every test):

  1. Fire _testing_reset via the keeper's daemon-token channel. The action wipes auth tables, seeds a fresh keeper (with extra_keeper_roles applied), seeds any extra_accounts, and returns the new credentials.
  2. Build the TestFixture closing over the new keeper as the fixture's primary account / actor (matching in-process semantics). fixture.extra_accounts[username] exposes any bootstrap-time secondaries.
  3. fixture.create_account() mints additional *post-bootstrap* accounts via the production signup + login flow (invite → signup → login → token). Roles go through offer/accept (production consent path).

No reset: boolean opt-in — every test runs against a freshly bootstrapped keeper. This converges in-process and cross-process keeper lifetimes; mutation-cascade tests (password change, revoke-all) and hardcoded-username signup tests work uniformly.

handle

options?

optional

returns

SetupTest

EXPIRED_SESSION_OFFSET_SECONDS
#

testing/cross_backend/setup.ts view source

-60 import {EXPIRED_SESSION_OFFSET_SECONDS} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Backdating offset (seconds) the mint_expired_session seam passes to mint_test_session / _testing_mint_session. A minute in the past is comfortably past NOW() for the DB-row expiry gate without depending on clock precision.

ExtraAccountSpec
#

testing/cross_backend/setup.ts view source

ExtraAccountSpec import type {ExtraAccountSpec} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Spec for a bootstrap-time secondary account seeded alongside the keeper by _testing_reset (cross-process) or create_test_app (in-process). Used for accounts whose required roles aren't admin-grantable via offer/accept — primarily ROLE_KEEPER (whose RoleSpec.grant_paths is bootstrap-only), where the only way to land the grant is at the bootstrap-equivalent setup step.

For admin-grantable roles, prefer fixture.create_account({roles}) — that goes through the production offer/accept handlers and observes audit + WS fan-out. extra_accounts is the cradle-only bypass; the runtime has no equivalent action.

username

type string

readonly

password_value?

type string

readonly

roles

type readonly string[]

readonly

parse_capture_answer
#

testing/cross_backend/setup.ts view source

<T extends AnySchema>(method: string, schema: T, raw: unknown): Infer<T> import {parse_capture_answer} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Parse a capture_* probe's answer with schema: the parsed value, or a throw naming method with the issues, so a shape drift between the TS and Rust answers fails loud at the boundary.

method

the _testing_* method that answered, named in the error

type string

schema

the answer's schema

type T

raw

the answer as it came off the wire

type unknown

returns

Infer<T>

the parsed answer, the schema's output

generics

parse_capture_answer<T extends AnySchema>
T
constraint AnySchema

throws

  • Error - when `raw` fails `schema`

reconstruct_bootstrapped_handle
#

testing/cross_backend/setup.ts view source

(serialized: SerializableBootstrappedBackendHandle): ReconstructedBootstrappedBackendHandle import {reconstruct_bootstrapped_handle} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Rebuild a usable handle from the serialized subset. Synthesizes a fresh FetchTransport primed with the keeper's Set-Cookie values so _testing_reset and other keeper-authenticated calls work. The returned shape omits child and teardown — lifecycle stays with globalSetup; tests that try to teardown themselves wouldn't have a serializable reference anyway.

serialized

returns

ReconstructedBootstrappedBackendHandle

ReconstructedBootstrappedBackendHandle
#

testing/cross_backend/setup.ts view source

ReconstructedBootstrappedBackendHandle import type {ReconstructedBootstrappedBackendHandle} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

BootstrappedBackendHandle minus the live child / teardown references that only make sense in the globalSetup process. The cross-process provide/inject path strips them on serialization, and the per-test helpers (mint_account, fire_testing_reset, default_cross_process_setup) never read either field — so the test-worker view of the handle has this shape. Also the return type of reconstruct_bootstrapped_handle.

daemon_token

Deterministic daemon token captured from config.bootstrap.daemon_token_path after the binary booted. default_cross_process_setup builds keeper-daemon-token headers from this for _testing_reset calls.

type string

readonly

keeper_actor

Keeper actor JSON captured from POST /bootstrap.

type { readonly id: Branded<string, "Uuid">; }

readonly

keeper_transport

Transport carrying the keeper session cookie + cookie jar.

type (url: string, init: RequestInit): Promise<Response>

readonly

url

type string

init

type RequestInit
returns Promise<Response>

keeper_daemon_transport

Daemon-token transport for the keeper — same cookie jar as keeper_transport but with origin: null so it sends no Origin header. The daemon-token middleware discards the credential in a browser context (any Origin / Referer), so the _testing_* daemon-token calls (_testing_reset / _testing_schema_snapshot / _testing_action_manifest / _testing_mint_session) must route through this Origin-free transport. CSRF/cookie-session calls (invite_create, role_grant_offer_create) stay on keeper_transport, which keeps its default Origin.

type (url: string, init: RequestInit): Promise<Response>

readonly

url

type string

init

type RequestInit
returns Promise<Response>

keeper_account

Keeper account JSON captured from POST /bootstrap.

type { readonly id: Branded<string, "Uuid">; readonly username: string; }

readonly

keeper_cookies

Raw keeper Set-Cookie values — thread into ws_transport for keeper-authenticated WS upgrades.

type readonly string[]

readonly

config

The config used to spawn this backend. Carried for diagnostic + downstream access.

type BackendConfig

readonly

RpcPathCapabilityGatedCrossSuiteOptions
#

testing/cross_backend/setup.ts view source

RpcPathCapabilityGatedCrossSuiteOptions import type {RpcPathCapabilityGatedCrossSuiteOptions} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

The RPC-dispatched shape for a capability-gating suite — the intersection of RpcPathCrossSuiteOptions and CapabilityGatedCrossSuiteOptions, and the most common option shape among the imperative cross suites (every cell_* suite, query_shape, token_scope_surface, fact_serving, account_lifecycle, testing_backdoor).

inheritance

RpcPathCrossSuiteOptions
#

testing/cross_backend/setup.ts view source

RpcPathCrossSuiteOptions import type {RpcPathCrossSuiteOptions} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

CrossSuiteOptions plus the RPC endpoint path the suite dispatches against — the shape every JSON-RPC-driven imperative suite takes (cell verbs, origin, body-size, actor lookup, account lifecycle, app settings). Suites alias this under a self-documenting per-suite name (e.g. OriginCrossTestOptions = RpcPathCrossSuiteOptions).

inheritance

rpc_path?

RPC endpoint path the methods are mounted on. Default /api/rpc.

type string

readonly

SerializableBootstrappedBackendHandle
#

testing/cross_backend/setup.ts view source

SerializableBootstrappedBackendHandle import type {SerializableBootstrappedBackendHandle} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Serializable subset of BootstrappedBackendHandle suitable for vitest's project.provide() — vitest 4 hard-rejects non-serializable values, so the live child: ChildProcess + teardown: () => Promise<void> + keeper_transport: FetchTransport (closure) must stay in the globalSetup process. The handful of fields tests actually read (config, daemon_token, keeper_account, keeper_actor, keeper_cookies) round-trip through structured clone fine.

globalSetup calls serialize_bootstrapped_handle before project.provide; test files call reconstruct_bootstrapped_handle on the injected value to rebuild a usable handle (without child / teardown — lifecycle stays with globalSetup).

config

type BackendConfig

readonly

daemon_token

type string

readonly

keeper_account

type { readonly id: Branded<string, "Uuid">; readonly username: string; }

readonly

keeper_actor

type { readonly id: Branded<string, "Uuid">; }

readonly

keeper_cookies

type readonly string[]

readonly

serialize_bootstrapped_handle
#

testing/cross_backend/setup.ts view source

(handle: BootstrappedBackendHandle): SerializableBootstrappedBackendHandle import {serialize_bootstrapped_handle} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Strip the non-serializable members so the result can be passed to vitest's project.provide. Call in globalSetup before provide.

handle

returns

SerializableBootstrappedBackendHandle

SetupTest
#

testing/cross_backend/setup.ts view source

SetupTest import type {SetupTest} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Fixture-producing function. Invoked once inside every test() body by default; a suite whose cases share no state past the reset may call it once in beforeAll instead. The implementation captures factory inputs (in-process) or a long-running backend handle (cross-process) and creates a fresh per-test bundle on each call.

(call)

type (): Promise<TestFixture>

returns Promise<TestFixture>

TestFixture
#

testing/cross_backend/setup.ts view source

TestFixture import type {TestFixture} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

The per-test bundle returned by SetupTest. Every Tier 1 suite body reads exclusively from this shape — no test_app.backend.* reads remain in the suite bodies.

Transport-agnostic: in-process and cross-process producers return the same shape. Behaviors that once needed raw backend access (keyring for forging cookies) are reached through wire-shaped seams instead — mint_expired_session() mints over the _testing_mint_session channel cross-process and directly in-process, so suite bodies never branch on the transport.

Keeper ≠ admin. fixture.account / fixture.actor refer to the fresh keeper seeded per test. The keeper account holds ROLE_KEEPER + ROLE_ADMIN by default — matching the production bootstrap_account flow. The ROLE_KEEPER role itself does *not* grant admin reach; the bootstrap account just happens to hold both as separate grants. Tests probing the keeper-vs-admin separation (e.g. "non-admin cannot list accounts") declare a secondary at setup-time via extra_accounts: [{username, roles: [ROLE_KEEPER]}] and read it from fixture.extra_accounts[username].

transport

Transport for this test's HTTP requests. Typed as FetchTransport so cross-process tests can call transport.cookies() for WS upgrade cookie threading; in-process provides a no-op cookies() returning [] (in-process tests construct cookies via create_session_headers directly and don't thread WS through this channel).

type (url: string, init: RequestInit): Promise<Response>

readonly

url

type string

init

type RequestInit
returns Promise<Response>

fresh_transport

Build a brand-new FetchTransport with an empty cookie jar pinned to the same backend. Use for unauthed assertions (`no cookie on protected route returns 401`, bearer-only calls expected to fall through to the unauthenticated path) where the per-test session cookie carried by transport's jar would otherwise leak into the request and convert a 401 into a 200.

New-per-call, not memoized — each invocation returns a fresh instance. If a call mutates the jar (e.g. an unauthed login attempt returning Set-Cookie) it can't pollute sibling calls.

Pass origin: null for bearer-only probes that must look like non-browser callers — the auth middleware silently discards bearer credentials when Origin/Referer is present, so a default Origin: <base_url> would convert "bearer + no Origin → 200" into "bearer + Origin → discarded → 401" cross-process. In-process the wrapper is stateless and the option is a no-op (no auto-Origin to suppress).

In-process this is functionally identical to transport (the wrapper's cookies(): [] is a no-op already); cross-process the returned transport starts with an empty jar at the same base_url.

type (options?: { readonly origin?: string | null | undefined; } | undefined): FetchTransport

readonly

options?

type { readonly origin?: string | null | undefined; }
optional

account

The freshly-bootstrapped keeper account.

type { readonly id: Branded<string, "Uuid">; readonly username: string; }

readonly

actor

The actor linked to the keeper account.

type { readonly id: Branded<string, "Uuid">; }

readonly

create_session_headers

Build request headers with the keeper's session cookie.

type (extra?: Record<string, string> | undefined): Record<string, string>

readonly

extra?

type Record<string, string>
optional
returns Record<string, string>

create_bearer_headers

Build request headers with the keeper's bearer token.

type (extra?: Record<string, string> | undefined): Record<string, string>

readonly

extra?

type Record<string, string>
optional
returns Record<string, string>

create_daemon_token_headers

Build request headers with the daemon token (keeper auth).

type (extra?: Record<string, string> | undefined): Record<string, string>

readonly

extra?

type Record<string, string>
optional
returns Record<string, string>

create_account

Mint an additional bootstrapped account for cross-account / multi-user tests. In-process: re-uses create_test_account_with_credentials against the same DB; cross-process: goes through the consumer-supplied DB-admin channel.

type (options?: CreateTestAccountOptions | undefined): Promise<TestAccount>

readonly

options?

optional
returns Promise<TestAccount>

extra_accounts

Bootstrap-time-seeded secondaries, keyed by their declared username. Populated from the extra_accounts option passed to default_in_process_setup / default_cross_process_setup. Empty for suites that don't declare any.

type Readonly<Record<string, TestAccount>>

readonly

extra_actors

Additional actors seeded on the keeper account (beyond its single bootstrap actor), in declaration order. Populated from the extra_actors option. Empty unless a suite declares any. Use to drive the multi-actor acting-selector branches: with extra_actors non-empty the keeper has >1 actor, so a keeper request omitting acting resolves to actor_required with these ids in its available[] list. Each id is a valid acting value the keeper can supply explicitly.

type readonly { readonly id: Branded<string, "Uuid">; readonly name: string; }[]

readonly

mint_expired_session

Forge an *expired server-side session* for the keeper account and return the ready-to-send Cookie header value (name=value). The minted auth_session row is backdated while the signed cookie payload stays valid — so resolution clears the cookie-payload gate (parse_session) and is refused at the authoritative DB-row gate (query_session_get_valid — WHERE expires_at > NOW()). Backs the expired_session conformance principal. In-process mints directly via mint_test_session; cross-process drives the _testing_mint_session RPC over the keeper's daemon-token channel (the driver has no keyring).

type (): Promise<string>

readonly
returns Promise<string>

reject_unknown_audit_metadata_keys?

Whether the suites' audit reads refuse metadata keys an event type doesn't declare — the setup's reject_unknown_audit_metadata_keys. list_audit_events and the admin suite's readers pass it to assert_audit_event_metadata.

type boolean

readonly

to_test_account
#

testing/cross_backend/setup.ts view source

(seeded: { account: { id: Branded<string, "Uuid">; username: string; }; actor: { id: Branded<string, "Uuid">; }; api_token: string; session_cookie: string; }, cookie_name: string): TestAccount import {to_test_account} from '@fuzdev/fuz_app/testing/cross_backend/setup.js';

Build a TestAccount from a seeded `{account, actor, api_token, session_cookie}` bundle and the session cookie name — the header builders close over its credentials.

Every fixture path that hands out a secondary account builds it here: the bootstrap-time extra_accounts (in-process via create_test_account_with_credentials, cross-process from the _testing_reset output) and the cross-process fixture.create_account.

seeded

the account's identity and credentials

type { account: { id: Branded<string, "Uuid">; username: string; }; actor: { id: Branded<string, "Uuid">; }; api_token: string; session_cookie: string; }

cookie_name

the backend's session cookie name

type string

returns

TestAccount

the account with its header builders

Depends on
#

Imported by
#