-
-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
test: add "application/protobuf" handling test #1443
test: add "application/protobuf" handling test #1443
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit bded29e:
|
We need to re-assess this test in the context of the recent MSW 2.0 release. I have a suspicion that this will no longer be an issue. I will rebase the branch and let's see. |
http.post('https://example.com/protobuf', async ({ request }) => { | ||
const buffer = await request.arrayBuffer() | ||
|
||
return new HttpResponse(new Uint8Array(buffer), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DGollings, hi 👋 Do you think it's necessary to preserve this conversion here or should be simply forward the buffer
as-is to the response? It'd also change how we assert the actual response body sent back.
In any case, the test is now passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't remember why that conversion is there, maybe to be slightly more realistic to actual usage? You generally don't respond with the exact request as-is (I think? Its been over a year)
Released: v2.0.7 🎉This has been released in v2.0.7! Make sure to always update to the latest version ( Predictable release automation by @ossjs/release. |
Added test which mimicks the behaviour I see in issue #1442
Simply returns the request, which should remain completely unchanged whilst moving through msw