Support for EventSource
See original GitHub issueI would like to see the EventSource support because we use it extensively in our app.
Current behavior:
cy.route doesn’t identify EventSource requests and there is no way to watch them reliably now.
Desired behavior:
Either cy.route should support it or we should have another API for EventSource.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Server-sent events | Can I use... Support tables for ... - CanIUse
Method of continuously sending data from a server to the browser, rather than repeatedly requesting it (EventSource interface, used to fall under HTML5)....
Read more >EventSource - Web APIs | MDN
desktop desktop
Chrome Edge
EventSource Full support. Chrome6. Toggle history Full support. Edge79. Tog...
EventSource() constructor Full support. Chrome6. Toggle history Full support. Edge79. Tog...
Read more >EventSource client for Node.js and Browser (polyfill) - GitHub
This library is a pure JavaScript implementation of the EventSource client. The API aims to be W3C compatible. You can use it with...
Read more >EventSource (Jersey 2.34 API)
The EventSource supports automated recuperation from a connection loss, including negotiation of delivery of any missed events based on the last received ...
Read more >EventSource Class (System.Diagnostics.Tracing)
Attempt to keep EventSource objects backwards compatible and version them appropriately. The default version for an event is 0 . The version can...
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 Free
Top 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

I’ve come up with a solution to mock EventSources in a Cypress test: You can use a package similar to https://github.com/gcedo/eventsourcemock
In your main file of your application, you can then add:
And in your test, you can use:
I hope this helps some people.
EDIT If you don’t want to add to your application’s main file, you can also use the solution from #2349
Same problem here:)