rafFn = function(fn) {
    var index = rafFn.queue.length;
    rafFn.queue.push(fn);
    return function() {
      rafFn.queue.splice(index, 1);
    };
  }
@ngdoc method
@name $timeout#verifyNoPendingTasks

@deprecated
sinceVersion="1.7.3"

This method takes all types of tasks (not only timeouts) into account, which is unintuitive.
It is recommended to use {@link ngMock.$verifyNoPendingTasks} instead, which additionally
allows checking for timeouts only (with `$verifyNoPendingTasks('$timeout')`).

@description

Verifies that there are no pending tasks that need to be flushed. It throws an error if there
are still pending tasks.

_This method is essentially an alias of {@link ngMock.$verifyNoPendingTasks} (called with no
arguments)._

<div class="alert alert-warning">
  <p>
    For historical reasons, this method will also verify non-`$timeout` pending tasks, such as
    pending {@link $http} requests, in-progress {@link $route} transitions, unresolved
    {@link $q} promises and tasks scheduled via
    {@link ng.$rootScope.Scope#$applyAsync $applyAsync} and
    {@link ng.$rootScope.Scope#$evalAsync $evalAsync}.
  </p>
  <p>
    It is recommended to use {@link ngMock.$verifyNoPendingTasks} instead, which additionally
    supports verifying a specific type of tasks. For example, you can verify there are no
    pending timeouts with `$verifyNoPendingTasks('$timeout')`.
  </p>
</div>