testing/cross_backend/cell_cross_helpers.ts

Shared call-site primitives for the cell cross-backend parity suites (testing/cross_backend/cell_crud.ts + testing/cross_backend/cell_relations.ts).

The cell verbs are stateful and authz-shaped, so both suites POST raw JSON-RPC envelopes (threading ids + auth headers across calls) and parse every success result against the verb's declared Zod output schema — the wire-shape parity gate. A TS↔Rust envelope drift, not just a payload field drift, fails the assertion.

$lib-free by contract (relative specifiers only) so the suites can be imported from the spawnable cross-process test files.

view source

Declarations
#

4 declarations

cross_rpc_call
#

testing/cross_backend/cell_cross_helpers.ts view source

(transport: FetchTransport, path: string, method: string, params: unknown, headers: Record<string, string>): Promise<RpcResult> import {cross_rpc_call} from '@fuzdev/fuz_app/testing/cross_backend/cell_cross_helpers.js';

POST a JSON-RPC call over a cross-process FetchTransport with the given auth headers. Distinct from testing/rpc_helpers.ts's app-based rpc_call: this variant drives the cookie-jar FetchTransport the cross-backend harness spawns against, and returns the slim RpcResult the cell suites read.

transport

path

type string

method

type string

params

type unknown

headers

type Record<string, string>

returns

Promise<RpcResult>

error_reason
#

expect_output
#

testing/cross_backend/cell_cross_helpers.ts view source

<T>(r: RpcResult, schema: ZodType<T, unknown, $ZodTypeInternals<T, unknown>>): T import {expect_output} from '@fuzdev/fuz_app/testing/cross_backend/cell_cross_helpers.js';

Assert the call succeeded and the result matches the verb's declared output schema — the wire-shape parity gate. Returns the parsed output.

r

schema

type ZodType<T, unknown, $ZodTypeInternals<T, unknown>>

returns

T

generics

expect_output<T>
T

RpcResult
#

testing/cross_backend/cell_cross_helpers.ts view source

RpcResult import type {RpcResult} from '@fuzdev/fuz_app/testing/cross_backend/cell_cross_helpers.js';

Minimal JSON-RPC envelope shape the suites read off responses.

ok

type boolean

readonly

result?

type unknown

readonly

error?

type {readonly code: number; readonly message: string; readonly data?: unknown}

readonly

Depends on
#

Imported by
#