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

MockRequest does not work for response data of type Buffer #299

Closed
katrotz opened this issue Mar 10, 2022 · 2 comments · Fixed by #302
Closed

MockRequest does not work for response data of type Buffer #299

katrotz opened this issue Mar 10, 2022 · 2 comments · Fixed by #302

Comments

@katrotz
Copy link

katrotz commented Mar 10, 2022

The change introduced in this PR#294 that clones the fixtures breaks the tests where the mocks are Buffers.
Same happens when the response is a typed array (eg. Uint8Array)

Expected:
When the mockRequest body is not a plain object, do not clone it, or clone it using specialised methods (eg. for Buffers Buffer.from, for Uint8Array Uint8Array.from, etc.)

Actual:
The buffer mock response is cloned into a plain object

@klippx
Copy link
Collaborator

klippx commented Mar 11, 2022

Related: #286

@klippx
Copy link
Collaborator

klippx commented Mar 16, 2022

The fix has now been relased in 2.38.1

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

Successfully merging a pull request may close this issue.

2 participants