diff --git a/types/whatwg-streams/whatwg-streams-tests.ts b/types/whatwg-streams/whatwg-streams-tests.ts index c7ed11928b..56246e0d97 100644 --- a/types/whatwg-streams/whatwg-streams-tests.ts +++ b/types/whatwg-streams/whatwg-streams-tests.ts @@ -371,11 +371,13 @@ declare class Request { readonly url: string; } declare class Response { - constructor(body?: ReadableStream); - readonly body: ReadableStream; + constructor(body?: ReadableStream); + readonly body: ReadableStream; } declare class TextDecoderStream extends TransformStream { } +declare class TextEncoderStream extends TransformStream { +} class LipFuzzTransformer implements TransformStreamTransformer { substitutions: Dictionary; @@ -439,7 +441,9 @@ class LipFuzzTransformer implements TransformStreamTransformer { // Decode the binary-encoded response to string .pipeThrough(new TextDecoderStream()) // Apply the LipFuzzTransformer - .pipeThrough(ts); + .pipeThrough(ts) + // Encode the transformed string + .pipeThrough(new TextEncoderStream()); return new Response(transformedBody); }) );