Improve this Doc View Source $verifyNoPendingTasks

  1. service in module ngMock

Overview

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

You can check for a specific type of tasks only, by specifying a taskType.

Available task types:

  • $timeout: Pending timeouts (via $timeout).
  • $http: Pending HTTP requests (via $http).
  • $route: In-progress route transitions (via $route).
  • $applyAsync: Pending tasks scheduled via $applyAsync.
  • $evalAsync: Pending tasks scheduled via $evalAsync. These include tasks scheduled via $evalAsync() indirectly (such as $q promises).
Periodic tasks scheduled via $interval use a different queue and are not taken into account by $verifyNoPendingTasks(). There is currently no way to verify that there are no pending $interval tasks.

Usage

$verifyNoPendingTasks([taskType]);

Arguments

Param Type Details
taskType
(optional)
string

The type of tasks to check for.

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.7.8/docs/api/ngMock/service/$verifyNoPendingTasks