Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response should allow for passing more than just a string #236

Open
taschmidt opened this issue Jul 12, 2022 · 0 comments
Open

Response should allow for passing more than just a string #236

taschmidt opened this issue Jul 12, 2022 · 0 comments

Comments

@taschmidt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant