| 864 | } |
| 865 | |
| 866 | class 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 | |
| 883 | class MockFetchResponse { |
| 884 | public url?: string; |