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

Class FiniteChunkFetchFactory

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected