Merge branch 'autotickuninstall' of https://github.com/atscott/jasmine

Merges #2057 from @atscott
This commit is contained in:
Steve Gravrock
2025-05-01 16:28:55 -07:00
3 changed files with 35 additions and 4 deletions

View File

@@ -3125,6 +3125,10 @@ getJasmineRequireObj().Clock = function() {
* @function
*/
this.uninstall = function() {
// Ensure auto ticking loop is aborted when clock is uninstalled
if (tickMode.mode === 'auto') {
tickMode = { mode: 'manual', counter: tickMode.counter + 1 };
}
delayedFunctionScheduler = null;
mockDate.uninstall();
replace(global, realTimingFunctions);