Helper to roundtrip through encode then decode
( messages: ServerSentEventMessage[], )
| 21 | |
| 22 | /** Helper to roundtrip through encode then decode */ |
| 23 | function roundtrip( |
| 24 | messages: ServerSentEventMessage[], |
| 25 | ): ReadableStream<ServerSentEventParsedMessage> { |
| 26 | return ReadableStream |
| 27 | .from(messages) |
| 28 | .pipeThrough(new ServerSentEventStream()) |
| 29 | .pipeThrough(new ServerSentEventParseStream()); |
| 30 | } |
| 31 | |
| 32 | Deno.test("ServerSentEventParseStream parses data field", async () => { |
| 33 | const result = await Array.fromAsync(parseStream([ |
no test coverage detected