From b9d5a473b9b1106d63dfc6acb00e1edcf8937cc3 Mon Sep 17 00:00:00 2001 From: thenickcox Date: Mon, 11 Nov 2013 08:30:32 -0800 Subject: [PATCH] Docs ($httpBackend): flush() The docs for the `flush()` method contained a few grammatical errors and were awkwardly worded. Change the explanation of the method to remove errors and read more naturally. --- src/ngMock/angular-mocks.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index f3a6138e007b..1ccaf14dd669 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -969,13 +969,12 @@ angular.mock.dump = function(object) { * * # Flushing HTTP requests * - * The $httpBackend used in production, always responds to requests with responses asynchronously. - * If we preserved this behavior in unit testing, we'd have to create async unit tests, which are - * hard to write, follow and maintain. At the same time the testing mock, can't respond - * synchronously because that would change the execution of the code under test. For this reason the - * mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending - * requests and thus preserving the async api of the backend, while allowing the test to execute - * synchronously. + * The $httpBackend used in production always responds to requests asynchronously. If we preserved + * this behavior in unit testing, we'd have to create async unit tests, which are hard to write, + * to follow and to maintain. But neither can the testing mock respond synchronously; that would + * change the execution of the code under test. For this reason, the mock $httpBackend has a + * `flush()` method, which allows the test to explicitly flush pending requests. This preserves + * the async api of the backend, while allowing the test to execute synchronously. * * * # Unit testing with mock $httpBackend @@ -2127,4 +2126,4 @@ angular.mock.clearDataCache = function() { } } }; -})(window); \ No newline at end of file +})(window);