Properly tick date along with clock

- Specifically when there aren't functions scheduled at the ticks

Fixes #1190
This commit is contained in:
Gregg Van Hove
2016-08-31 21:24:01 -07:00
parent 5a2e1b0082
commit c7cc3b4a29
2 changed files with 15 additions and 2 deletions

View File

@@ -116,7 +116,7 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
function runScheduledFunctions(endTime, tickDate) {
tickDate = tickDate || function() {};
if (scheduledLookup.length === 0 || scheduledLookup[0] > endTime) {
tickDate(endTime);
tickDate(endTime - currentTime);
return;
}
@@ -143,6 +143,11 @@ getJasmineRequireObj().DelayedFunctionScheduler = function() {
// scheduled in a funcToRun from forcing an extra iteration
currentTime !== endTime &&
scheduledLookup[0] <= endTime);
// ran out of functions to call, but still time left on the clock
if (currentTime !== endTime) {
tickDate(endTime - currentTime);
}
}
}