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

Class FiniteChunkFetchFactory

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

Source from the content-addressed store, hash-verified

893}
894
895class FiniteChunkFetchFactory extends FetchFactory {
896 override fetch = async (_input: RequestInfo | URL, _init?: RequestInit): Promise<Response> => {
897 const stream = new ReadableStream<Uint8Array>({
898 start: (controller) => {
899 controller.enqueue(new TextEncoder().encode('ok'));
900 controller.close();
901 },
902 });
903
904 return new Response(stream, {
905 status: HttpStatusCode.Ok,
906 statusText: 'OK',
907 headers: {'Content-Type': 'text/plain', 'Content-Length': '2'},
908 });
909 };
910}
911
912class MockFetchResponse {
913 public url?: string;

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected