Extending the Stream prototype has been tried but created issues that were reverted at the immediate posterior release.
There are several issues raised around support for Streams, and probably without breaking the current API, we can provide a decorator for request.pipe() that would make easier to integrate with handlers that expect a ReadableStream rather than json or urlencoded body.
Originally posted by @amitguptagwl in https://github.com/eugef/node-mocks-http/issues/166#issuecomment-377493744
Extending the Stream prototype has been tried but created issues that were reverted at the immediate posterior release.
There are several issues raised around support for Streams, and probably without breaking the current API, we can provide a decorator for
request.pipe()
that would make easier to integrate with handlers that expect a ReadableStream rather than json or urlencoded body.