testing/cross_backend/standard.ts

One call wiring the standard suites that run against a spawned backend — the ones whose option shape is {setup_test, surface_source, capabilities, ...} and whose bodies fire requests through fixture.transport rather than touching the in-process Backend. Consumers wire one call against a spawned binary instead of repeating the sibling calls per file.

Suites included — always run:

Gated on roles — included when the consumer supplies a RoleRegistry:

Suites omitted — the ones that don't survive a process boundary, documented here so per-consumer files don't have to repeat the bookkeeping:

  • describe_rate_limiting_tests — builds a fresh TestApp per test to inject tight per-test rate-limiter overrides. That path requires in-process construction of Backend + rate limiter; the spawned binary has neither knob nor restart-per-test budget.
  • describe_audit_completeness_tests — reaches into FK-structural introspection that only the in-process backend exposes. Wire-level audit observability lives in the consumer's own audit .cross.test.ts driving audit_log_list / audit_log_role_grant_history.
view source

Declarations
#

2 declarations

describe_standard_cross_process_tests
#

testing/cross_backend/standard.ts view source

(options: StandardCrossProcessTestOptions): void import {describe_standard_cross_process_tests} from '@fuzdev/fuz_app/testing/cross_backend/standard.js';

Run the cross-process standard test bundle — integration, admin (when roles provided), round trip, RPC round trip, data exposure. See the module doc for the suites omitted from this bundle and why.

options

returns

void

StandardCrossProcessTestOptions
#

testing/cross_backend/standard.ts view source

StandardCrossProcessTestOptions import type {StandardCrossProcessTestOptions} from '@fuzdev/fuz_app/testing/cross_backend/standard.js';

Configuration for describe_standard_cross_process_tests.

The in-process suites' shared options minus their in-process-only knobs (create_route_specs, rate_limiting_app_options).

setup_test

Per-test fixture-producing function.

type (): Promise<TestFixture>

returns Promise<TestFixture>

surface_source

App surface. Constructed in TS by the consumer; same shape for in-process and cross-process tests.

type AppSurfaceSpec

capabilities

Backend capability declarations. Forwarded to the one bundled suite that gates on them (describe_standard_integration_tests); the other suites in the bundle read no flags and take no capability field.

type BackendCapabilities

session_options

Session config — needed for cookie_name + factory-form rpc_endpoints resolution.

type SessionOptions<string>

rpc_endpoints

RPC endpoint specs — required. The standard integration tests drive account_verify, account_session_*, account_token_* through the RPC surface (and admin tests, when wired, drive role_grant grant/revoke through it too).

type RpcEndpointsSuiteOption

roles?

Role registry from create_role_registry(). When provided, the admin integration suite is included.

type RoleRegistry

admin_prefix?

Path prefix where admin routes are mounted. Default '/api/admin'.

type string

error_coverage_min?

Forwarded to describe_standard_integration_tests — overrides the default error-coverage threshold on the scoped REST surface. Set to 0 to skip the assertion entirely.

type number

base_url

Base URL the spawned backend is reachable at. Forwarded to describe_standard_integration_tests, whose middleware-gate probes write their request heads to the socket.

type string

max_body_bytes?

Forwarded to describe_standard_integration_tests — the backend's request-body cap on every counted route but the RPC endpoint, when it isn't the spine default.

type number

rpc_max_body_bytes?

Forwarded to describe_standard_integration_tests — the backend's request-body cap on the RPC endpoint, when it isn't max_body_bytes.

type number

check_uncovered_errors?

Forwarded to describe_standard_integration_tests — called with the declared error paths of its counted routes it never observed.

type (uncovered: UncoveredEntry[]): void

uncovered

returns void

round_trip_skip_routes?

Forwarded to describe_round_trip_validation as skip_routes ('METHOD /path' keys). For consumer REST routes whose responses aren't JSON-with-an-output-schema and so can't be round-tripped — e.g. fuz_forge's git smart-HTTP routes (git-upload-pack / git-receive-pack / info/refs) which stream git protocol bytes.

type string[]

data_exposure_skip_routes?

Forwarded to describe_data_exposure_tests as skip_routes ('METHOD /path' keys for routes, '/path method_name' for RPC or WS method outputs, '/path method_name params' for params the server pushes over WS), as the in-process bundle's consumers pass it directly.

type string[]

param_values?

Forwarded to describe_round_trip_validation and describe_data_exposure_tests as param_values ('METHOD /path' → param name → value), for a {re} param whose pattern refuses the generated value. See RouteParamValues.

type Readonly<Record<string, Readonly<Record<string, string>>>>

rpc_success_fixtures?

Forwarded to describe_rpc_round_trip_tests as success_fixtures (method name → async params factory). Drives a populated success body for referential RPC reads (*_get, *_log) the nil-id round-trip can only ever error on, and validates it against the method's output schema on each backend — the success-shape parity check. See RpcRoundTripTestOptions.success_fixtures.

type RpcSuccessFixtures

rpc_skip_methods?

Forwarded to describe_rpc_round_trip_tests as skip_methods — the consumer escape hatch for a method the generic round-trip can't drive at all (a handler whose test wiring stubs out the deps it reaches, or reads tables the suite's database doesn't migrate). Each entry hides the method from both the crash check and the envelope check, so name the reason beside it.

type string[]

rpc_input_overrides?

Forwarded to describe_rpc_round_trip_tests as input_overrides (method name → params) — for a method whose generated params can't reach its handler cleanly. The response is held to the same rules as a generated one.

type Map<string, Record<string, unknown>>

rest_success_fixtures?

Forwarded to describe_round_trip_validation as success_fixtures ('METHOD /path' → async {url?, body?} factory) for referential REST routes. See RoundTripTestOptions.success_fixtures.

type Map<string, (fixture: TestFixture) => Promise<{ url?: string | undefined; body?: Record<string, unknown> | undefined; }>>

Depends on
#

Imported by
#