Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Mock out the network call (which you'd be doing anyway because unit tests never connect to the network) so it always returns a failure. Mock out the timer.

Call the function multiple times and ensure it'd passing the expected wait durations in for each time it's called followed by a fatal error after say 30 seconds.



> Mock out the network call

Man, the day this hits, just know I didn't judge you at all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: