@@ -1789,14 +1789,18 @@ function createHttpBackendMock($rootScope, $timeout, $delegate, $browser) {
1789
1789
* @ngdoc method
1790
1790
* @name $httpBackend#flush
1791
1791
* @description
1792
- * Flushes pending requests in the order they arrived beginning at specified request using the trained responses.
1793
- * If there are no pending requests to flush when the method is called
1794
- * an exception is thrown (as this typically a sign of programming error).
1795
- *
1796
- * @param {number= } count Number of responses to flush. If undefined,
1797
- * all pending requests from `skip` will be flushed.
1798
- * @param {number= } [skip=0] Number of pending requests to skip before flushing.
1799
- * So it specifies the first request to flush.
1792
+ * Flushes pending requests using the trained responses. Requests are flushed in the order they
1793
+ * were made, but it is also possible to skip one or more requests (for example to have them
1794
+ * flushed later). This is useful for simulating scenarios where responses arrive from the server
1795
+ * in any order.
1796
+ *
1797
+ * If there are no pending requests to flush when the method is called, an exception is thrown (as
1798
+ * this is typically a sign of programming error).
1799
+ *
1800
+ * @param {number= } count - Number of responses to flush. If undefined/null, all pending requests
1801
+ * (starting after `skip`) will be flushed.
1802
+ * @param {number= } [skip=0] - Number of pending requests to skip. For example, a value of `5`
1803
+ * would skip the first 5 pending requests and start flushing from the 6th onwards.
1800
1804
*/
1801
1805
$httpBackend . flush = function ( count , skip , digest ) {
1802
1806
if ( digest !== false ) $rootScope . $digest ( ) ;
0 commit comments