myty
myty2mo ago

Mocking EventSource

I'm writing tests for functionality that depends on EventSource and I'd like to mock EventSource entirely, but can't quite figure out how to get it to work. I've been referencing https://docs.deno.com/examples/mocking_tutorial/#stubbing and from what I can tell, stubs are for only replacing a method, not an entire class. Before I resort to wrapping it with another class that I can mock, does anyone have any ideas around this?
Deno
Testing in isolation with mocks
Master the art of mocking in your unit tests. Learn how spies, stubs, fake time, and other Deno tools let you improve your code and confidence
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?