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
When client script is executed, either because of a <script> tag, or executing an event handler/timeout handler, all immediately enqueued items are implicitly executed. I.e., all timeouts registered for the current simulated point in time.
For an application might have animations, the events may be registered in the future, and will require tests to explicitly advance time, either by a specific amount, calling Clock.Advance, or just run all scheduled handlers calling Clock.RunAll.
To keep test code focused on behaviour, such calls become noise, and a way to handle it would be to allow the test code to specify an amount of time to implicitly increment, or implicitly run all enqueued tasks.
It is more likely that test code doesn't care about the amount of time that passes, and only in the rarer cases when you want to explicitly verify debounce/throttle behaviour, that the test need 100% control over simulated time.
The text was updated successfully, but these errors were encountered:
When client script is executed, either because of a
<script>
tag, or executing an event handler/timeout handler, all immediately enqueued items are implicitly executed. I.e., all timeouts registered for the current simulated point in time.For an application might have animations, the events may be registered in the future, and will require tests to explicitly advance time, either by a specific amount, calling
Clock.Advance
, or just run all scheduled handlers callingClock.RunAll
.To keep test code focused on behaviour, such calls become noise, and a way to handle it would be to allow the test code to specify an amount of time to implicitly increment, or implicitly run all enqueued tasks.
It is more likely that test code doesn't care about the amount of time that passes, and only in the rarer cases when you want to explicitly verify debounce/throttle behaviour, that the test need 100% control over simulated time.
The text was updated successfully, but these errors were encountered: