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

Class FiniteChunkFetchFactory

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

Source from the content-addressed store, hash-verified

1061}
1062
1063class FiniteChunkFetchFactory extends FetchFactory {
1064 override fetch = async (_input: RequestInfo | URL, _init?: RequestInit): Promise<Response> => {
1065 const stream = new ReadableStream<Uint8Array>({
1066 start: (controller) => {
1067 controller.enqueue(new TextEncoder().encode('ok'));
1068 controller.close();
1069 },
1070 });
1071
1072 return new Response(stream, {
1073 status: HttpStatusCode.Ok,
1074 statusText: 'OK',
1075 headers: {'Content-Type': 'text/plain', 'Content-Length': '2'},
1076 });
1077 };
1078}
1079
1080class MockFetchResponse {
1081 public url?: string;

Callers

nothing calls this directly

Calls 2

enqueueMethod · 0.80
closeMethod · 0.65

Tested by

no test coverage detected