intercept() sometimes parses request or response body as ArrayBuffer
See original GitHub issueCurrent behavior
Some intercepts don’t parse request or response body well, instead of JSON, it is parsed as ArrayBuffer.
Test code to reproduce
You can find the whole code example here. I was unable to pin down what kind of response or request body caused this. I tried to create a minimalistic example but I ended up just copying the whole payload from the app I’m testing.
Versions
Problem appears from v7 and higher. .intercept()
actually behaves well on 6.x versions.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Cypress 9.6.0 - response returned from cy.request has a body ...
The issue is that instead of an ArrayBuffer I should be getting normal JSON format response (ofc during the test in the app...
Read more >Response.arrayBuffer() - Web APIs - MDN Web Docs
In getData() we create a new request using the Request() constructor, then use it to fetch an OGG music track. We also use...
Read more >The new Angular HttpClient API - Medium
The intercept method receives an HttpRequest and must return an stream of HttpEvent of type HttpResponse . As the Request and Response objects...
Read more >7 Ways to Leverage HttpInterceptors in Angular - Bits and Pieces
HttpInterceptors, as their name suggests, intercept Http requests made ... This is used to parse the response appropriately before returning ...
Read more >parse-request - npm
Parse requests in the Browser and Node (with added support for ... a 10MB file image upload sent across the request body as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same issue with Russian letters
Similar issue with tilde latin letters (
áéíóú
) with cypress version7.6.0
. Few notes:8.1.0
did not help6.9.1
workedI’ve also found https://github.com/cypress-io/cypress/issues/16292 which seems fixed, but may not.