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