I am trying to convert Mules to Cats Effect 3 (CE3). Since it is a caching library, in its tests it needs (virtual) time to pass to test whether items will be expired. It is currently making fairly heavy use of cats.effect.laws.util.TestContext
, which allows advancing the virtual clock without actually sleeping via tick
. TestContext
does not (as far as I have been able to discover) exist in CE3, but I am always loathe to puts sleep
calls into a test. Rolling my own IO
for this specific case though is a daunting prospect; surely this is a more general problem people have. I was not able to find a reference to TestContext
in the migration guide, however.
Is there a known upgrade path for this case?
TestContext
doc seems outdated for 3.x CE -- it has notimer
method no more (timer is replaced withTemporal
, per docs). I'm new to CE, so wondering which API could be used here. – Styracaceous