cron icon indicating copy to clipboard operation
cron copied to clipboard

Add Time Mocking

Open tooolbox opened this issue 4 years ago • 3 comments

This PR adds a WithClock() option, which uses mixer/clock to simulate the passage of time. Tests can be written to, for example, verify the behavior of a given schedule.

This comes in handy for me personally as I'd like to test the interaction of a cron with my own service, over a long period of time.

tooolbox avatar Jul 13 '20 20:07 tooolbox

+1, @robfig would you be interested in merging this?

shubham1172 avatar Oct 28 '22 15:10 shubham1172

+1.
Without mockable clock unit tests are ugly.

roynwang avatar Nov 08 '22 03:11 roynwang

+1. Without mockable clock unit tests are ugly.

+10086

ShiyiWei1995 avatar Nov 08 '22 03:11 ShiyiWei1995