You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So while tests may pass, the code might fail in real life.
I suggest to add an option to clock.tick(ms[, shouldRunSimultaneousHandlersInReversOrder]) as an API for test writers who want to test against this problem. The option basically will affect these lines (maybe only last two ifs), I think.
This feature request is very unlikely to be prioritized by us, so I am closing this, but you could submit a PR. The API might have to be discussed a bit though, but that's just details.
Currently when two handlers set to be called at the same time, lolex guarantees that they will be called in the order they were set.
For example in the following setup
foo
is always called first:Although this is not guaranteed by the real implementations of
setTimeout
and friends:So while tests may pass, the code might fail in real life.
I suggest to add an option to
clock.tick(ms[, shouldRunSimultaneousHandlersInReversOrder])
as an API for test writers who want to test against this problem. The option basically will affect these lines (maybe only last twoif
s), I think.More context: https://github.com/rpominov/kefir/issues/134 https://github.com/rpominov/kefir/pull/135
cc @agentme
The text was updated successfully, but these errors were encountered: