testing/cross_backend/cross_rpc.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/cross_rpc.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 suites read.
transport
the transport to send on
path
the RPC endpoint path
stringmethod
the JSON-RPC method
stringparams
the request params
unknownheaders
auth and other headers, merged over the JSON defaults
Record<string, string>returns
Promise<RpcResult>
the response's HTTP status, ok, result and error
throws
Error- when the reply is not a JSON object — naming the method, the HTTP status and the head of the body, so a proxy page or a crash reads as what it is