Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 541 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 541 Bytes

timecop

nimble install timecop

timecop requires subhook module and not production ready

timecop provides two helpers freezeAt and travelTo template, that will helps you do unittest on specified time

Usage

import times, timecop

freezeAt now():
  # time never changes inside this code block
  echo now()
  sleep(10_000)
  echo now()  

travelTo now() - 1.days:
  # time will starts on yesterday, and continue running
  echo now()
  sleep(10_000)
  echo now()