Bug: experimentalFetchPolyfill doesn't handle new Request API
See original GitHub issueCurrent behavior:
When constructing a request using fetch’s new experimental polyfill and the new Request
API, we send [object Request]
in the URL’s path. When the experimental polyfill is off, we correctly stringify the URL’s path.
Desired behavior:
Should behave like XHR would when dealing with the new Request
API
Test code to reproduce
In https://github.com/cypress-io/cypress-test-tiny/tree/query-string if you change the ajax.html
fixture to use an example from MDN’s site then you’ll see the above screenshot.
const myHeaders = new Headers();
const myRequest = new Request('flowers.jpg?size=300', {
method: 'GET',
headers: myHeaders,
mode: 'cors',
cache: 'default',
});
fetch(myRequest)
.then(()) => console.log(...arguments))
Versions
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:19 (8 by maintainers)
Top Results From Across the Web
Experimental Fetch Polyfill - Cypress
This application presents two challenges to end-to-end tests. First, the data is random - every time the test visits the page localhost:7080 a ......
Read more >Fetch API requests are not timed - New Relic Explorers Hub
Hello, We are using New Relic Browser to track user behaviour and app performance in our single-page-app. The New Relic Browser agent ...
Read more >electron-fetch | Yarn - Package Manager
fetch API. Runs on both Electron and Node.js, using either Electron's net module, or Node.js http module as backend. Make conscious trade-off when...
Read more >ReferenceError: fetch is not defined - javascript - Stack Overflow
If you use the new version(3.0.0) , it will get an error in import and then you'll get another one that says "fetch...
Read more >Using Fetch
Headers; Response objects; Body; Feature detection; Polyfill; Specifications; Browser compatibility; See also. The Fetch API provides a JavaScript interface for ...
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
I have the same problem that @JessicaSachs reported but I’m using ky. Since the native
fetch
support this feature I think that cypress should use a polyfill that supports that too.Gotcha, please follow that issue 8487 to get notified when it gets resolved.
@cainskelton if you are just interested in knowing if a resource has been loaded you can use performance API, see https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/testing-dom__wait-for-resource