A scala.concurrent.ExecutionContext
implementation and a provider
of cats.effect.Timer
instances, that can simulate async boundaries
and time passage, useful for testing purposes.
Defines instances for Future
and for IO
, meant for law testing
by means of TestContext.
Defines instances for Future
and for IO
, meant for law testing
by means of TestContext.
The TestContext interpreter is used here for simulating asynchronous execution.
A
scala.concurrent.ExecutionContext
implementation and a provider ofcats.effect.Timer
instances, that can simulate async boundaries and time passage, useful for testing purposes.Usage for simulating an
ExecutionContext
):Our
TestContext
can also simulate time passage, as we are able to builds acats.effect.Timer
instance for any data type that has aLiftIO
instance:We can now simulate actual time:
Simulating time makes this pretty useful for testing race conditions: