Skip to content

Commit 29432ff

Browse files
sflahavejeffbcross
authored andcommitted
Edited the 'Flushing HTTP requests' section
Minor grammatical edits in the Flushing HTTP requests section.
1 parent caed2df commit 29432ff

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ngMock/angular-mocks.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -989,18 +989,18 @@ angular.mock.dump = function(object) {
989989
*
990990
* # Flushing HTTP requests
991991
*
992-
* The $httpBackend used in production, always responds to requests with responses asynchronously.
993-
* If we preserved this behavior in unit testing, we'd have to create async unit tests, which are
994-
* hard to write, follow and maintain. At the same time the testing mock, can't respond
992+
* The $httpBackend used in production always responds to requests with responses asynchronously.
993+
* If we preserved this behavior in unit testing we'd have to create async unit tests, which are
994+
* hard to write, understand, and maintain. However, the testing mock can't respond
995995
* synchronously because that would change the execution of the code under test. For this reason the
996996
* mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending
997-
* requests and thus preserving the async api of the backend, while allowing the test to execute
997+
* requests and thus preserve the async api of the backend while allowing the test to execute
998998
* synchronously.
999999
*
10001000
*
10011001
* # Unit testing with mock $httpBackend
1002-
* The following code shows how to setup and use the mock backend in unit testing a controller.
1003-
* First we create the controller under test
1002+
* The following code shows how to setup and use the mock backend when unit testing a controller.
1003+
* First we create the controller under test:
10041004
*
10051005
<pre>
10061006
// The controller code
@@ -1025,7 +1025,7 @@ angular.mock.dump = function(object) {
10251025
}
10261026
</pre>
10271027
*
1028-
* Now we setup the mock backend and create the test specs.
1028+
* Now we setup the mock backend and create the test specs:
10291029
*
10301030
<pre>
10311031
// testing controller

0 commit comments

Comments
 (0)