Skip to content

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

Open
@taschmidt

Description

@taschmidt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions