(...chunks: Uint8Array[])
| 52 | } |
| 53 | |
| 54 | function streamOf(...chunks: Uint8Array[]): ReadableStream<Uint8Array> { |
| 55 | let i = 0; |
| 56 | return new ReadableStream<Uint8Array>({ |
| 57 | pull(controller) { |
| 58 | if (i < chunks.length) { |
| 59 | controller.enqueue(chunks[i++]); |
| 60 | } else { |
| 61 | controller.close(); |
| 62 | } |
| 63 | }, |
| 64 | }); |
| 65 | } |
| 66 | |
| 67 | describe("writeFile", () => { |
| 68 | it("writes a small string and stores one chunk", async () => { |