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

Commit 5cb9465

Browse files
committed
docs(ngMock/$timeout): deprecate flush() and verifyNoPendingTasks()
Closes #16603
1 parent 58f9413 commit 5cb9465

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/ngMock/angular-mocks.js

+15
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,13 @@ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $
22782278
/**
22792279
* @ngdoc method
22802280
* @name $timeout#flush
2281+
*
2282+
* @deprecated
2283+
* sinceVersion="1.7.3"
2284+
*
2285+
* This method flushes all types of tasks (not only timeouts), which is unintuitive.
2286+
* It is recommended to use {@link ngMock.$flushPendingTasks} instead.
2287+
*
22812288
* @description
22822289
*
22832290
* Flushes the queue of pending tasks.
@@ -2303,6 +2310,14 @@ angular.mock.$TimeoutDecorator = ['$delegate', '$browser', function($delegate, $
23032310
/**
23042311
* @ngdoc method
23052312
* @name $timeout#verifyNoPendingTasks
2313+
*
2314+
* @deprecated
2315+
* sinceVersion="1.7.3"
2316+
*
2317+
* This method takes all types of tasks (not only timeouts) into account, which is unintuitive.
2318+
* It is recommended to use {@link ngMock.$verifyNoPendingTasks} instead, which additionally
2319+
* allows checking for timeouts only (with `$verifyNoPendingTasks('$timeout')`).
2320+
*
23062321
* @description
23072322
*
23082323
* Verifies that there are no pending tasks that need to be flushed. It throws an error if there

0 commit comments

Comments
 (0)