fakeServer and testing Network Timeouts

32 views
Skip to first unread message

Joe Marty

unread,
Jul 17, 2017, 7:25:57 PM7/17/17
to Sinon.JS
I have an app that is sending a request with a timeout of 20000 (I can see that in the timeout property of the request in the fakeServer's requests array).  And I'm trying to write a test that tests the timeout response in the app.  But for some reason, whether I just keep the browser open for 20 seconds or use sinon's fakeTimers, the faked request is not timing out. Is there something I have to do to allow fake requests to time out?  I wish there were just a function similar to `request.error()` that would cause the request to timeout (e.g. `request.timeout()`)

But I don't see anything about that in the documentation.  Any ideas?

Thanks!
-Joe
Reply all
Reply to author
Forward
0 new messages