I have a unit test I'm converting over to use this library. Since the method I'm testing reads from Response.body like a stream (which follows the fetch API docs), the previous version of the unit test passed a Readable.from(... abitrary data ...). However, this lib only will allow me to pass a string.
I was able to work around it by calling fetchMock.mockResponse(Readable.from( ... ) as any) but it would be nice if I didn't have to cast.
I have a unit test I'm converting over to use this library. Since the method I'm testing reads from Response.body like a stream (which follows the fetch API docs), the previous version of the unit test passed a
Readable.from(... abitrary data ...)
. However, this lib only will allow me to pass a string.I was able to work around it by calling
fetchMock.mockResponse(Readable.from( ... ) as any)
but it would be nice if I didn't have to cast.