Closed MichaelSnowden closed 11 months ago
Take a look at #69 . I think we can find a way meet your needs without adding dimensionality to the behavior of FakeClock
Take a look at #69 . I think we can find a way meet your needs without adding dimensionality to the behavior of
FakeClock
Hmm, how would you do something like the TestFakeClockSynchronousAfterFunc
test I have here with the Expirations()
and BlockUntilContext()
APIs? I think you can be sure that the function started, but, for my use case, I still need some indication that whatever timer callback there was finished. I think something more like Flush(ctx)
which blocks until all channels are sent to and all callbacks are done would be better.
This is for https://github.com/jonboulle/clockwork/issues/67
I'm happy to add more context if you'd like, but the main idea is that this makes it a lot easier to test certain things. For example, if you want to verify that a timer did fire without this option, you could just block for a while and wait for it to return. However, if you wanted to verify that timer did not fire, you'd have to set an arbitrary wait amount.