Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit ebfa1a8

Browse files
committed
docs(ngMock/$timeout): deprecate flush() and verifyNoPendingTasks()
1 parent 9d3b307 commit ebfa1a8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ngMock/angular-mocks.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,13 @@ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $
22712271
/**
22722272
* @ngdoc method
22732273
* @name $timeout#flush
2274+
*
2275+
* @deprecated
2276+
* sinceVersion="1.7.3"
2277+
*
2278+
* This method flushes all types of tasks (not only timeouts), which is unintuitive.
2279+
* It is recommended to use {@link ngMock.$flushPendingTasks} instead.
2280+
*
22742281
* @description
22752282
*
22762283
* Flushes the queue of pending tasks.
@@ -2296,6 +2303,14 @@ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $
22962303
/**
22972304
* @ngdoc method
22982305
* @name $timeout#verifyNoPendingTasks
2306+
*
2307+
* @deprecated
2308+
* sinceVersion="1.7.3"
2309+
*
2310+
* This method takes all types of tasks (not only timeouts) into account, which is unintuitive.
2311+
* It is recommended to use {@link ngMock.$verifyNoPendingTasks} instead, which additionally
2312+
* allows checking for timeouts only (with `$verifyNoPendingTasks('$timeout')`).
2313+
*
22992314
* @description
23002315
*
23012316
* Verifies that there are no pending tasks that need to be flushed. It throws an error if there

0 commit comments

Comments
 (0)