@RaceProUK You don't even really have to use Sinon if you have another method of mocking out Thread.sleep(). The key is, you want to control the scheduling, not leave that up to the OS. Then you schedule the callback immediately and verify that it runs correctly.

sinon just makes it easier because it controls the passage of time, so you can say "100 ms passed, did the callback run?".

Ditto for async stuff, really: you want to control the scheduling of routines within the test. So you can say, run this one, run that one, check if this other one ran.