Bun samples are verified on Bun 1.3.13; HTTP/2 clients need Bun >= 1.2.6, and a few packages skip their Bun suite in CI. Runtime compatibility
Connectum API Reference / @connectum/test-fixtures / index / createMockNext
Function: createMockNext() โ
createMockNext(
options?):any
Defined in: mock-next.ts:36
Create a mock next handler that resolves with a successful response.
The returned function is a spy (via createMockFn), so callers can inspect next.mock.calls and next.mock.callCount() after the test.
Parameters โ
options? โ
Optional overrides for the response payload and stream flag.
Returns โ
any
A spy-enabled async function matching the ConnectRPC next signature.
Example โ
ts
import { createMockNext } from "@connectum/testing";
const next = createMockNext({ message: { id: 1 } });
const res = await next({});
// res.message => { id: 1 }
// next.mock.callCount() => 1