method MockResponse.prototype.stream
Since 0.2.0
MockResponse.prototype.stream(body: ReadableStream<Uint8Array>): HandlerResult

Sends a streaming response body.

Accepts a web-standard ReadableStream so that a handler can flush bytes progressively over a long-lived connection instead of buffering a whole body before send. This is the shared foundation for Server-Sent Events (Milestone 43), React SSR streaming (Milestone 44), large file downloads (storage-plugin, Milestone 28), and export / report responses.

Because the runtime maps the response to a web-standard new Response(streamBody, { status, headers }), streaming is free on every platform (Node via Hono, Deno, Bun, Cloudflare Workers) with no buffer-then-send.

Parameters

A ReadableStream of Uint8Array chunks

Return Type

HandlerResult

The handler result

Usage

import { MockResponse } from "testing/src/index.ts";