| 802 | } |
| 803 | |
| 804 | class FiniteChunkFetchFactory extends FetchFactory { |
| 805 | override fetch = async (_input: RequestInfo | URL, _init?: RequestInit): Promise<Response> => { |
| 806 | const stream = new ReadableStream<Uint8Array>({ |
| 807 | start: (controller) => { |
| 808 | controller.enqueue(new TextEncoder().encode('ok')); |
| 809 | controller.close(); |
| 810 | }, |
| 811 | }); |
| 812 | |
| 813 | return new Response(stream, { |
| 814 | status: HttpStatusCode.Ok, |
| 815 | statusText: 'OK', |
| 816 | headers: {'Content-Type': 'text/plain'}, |
| 817 | }); |
| 818 | }; |
| 819 | } |
| 820 | |
| 821 | class MockFetchResponse { |
| 822 | public url?: string; |