MCPcopy Create free account
hub / github.com/angular/angular / FiniteChunkFetchFactory

Class FiniteChunkFetchFactory

packages/common/http/test/fetch_spec.ts:866–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864}
865
866class FiniteChunkFetchFactory extends FetchFactory {
867 override fetch = async (_input: RequestInfo | URL, _init?: RequestInit): Promise<Response> => {
868 const stream = new ReadableStream<Uint8Array>({
869 start: (controller) => {
870 controller.enqueue(new TextEncoder().encode('ok'));
871 controller.close();
872 },
873 });
874
875 return new Response(stream, {
876 status: HttpStatusCode.Ok,
877 statusText: 'OK',
878 headers: {'Content-Type': 'text/plain'},
879 });
880 };
881}
882
883class MockFetchResponse {
884 public url?: string;

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected