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

Commit 3248233

Browse files
thenickcoxpkozlowski-opensource
authored andcommitted
docs(ngMock): fixes in flush() documentation
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. Closes #4886
1 parent 3a8bbb7 commit 3248233

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/ngMock/angular-mocks.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -960,13 +960,12 @@ angular.mock.dump = function(object) {
960960
*
961961
* # Flushing HTTP requests
962962
*
963-
* The $httpBackend used in production always responds to requests with responses asynchronously.
964-
* If we preserved this behavior in unit testing we'd have to create async unit tests, which are
965-
* hard to write, understand, and maintain. However, the testing mock can't respond
966-
* synchronously because that would change the execution of the code under test. For this reason the
967-
* mock $httpBackend has a `flush()` method, which allows the test to explicitly flush pending
968-
* requests and thus preserve the async api of the backend while allowing the test to execute
969-
* synchronously.
963+
* The $httpBackend used in production always responds to requests asynchronously. If we preserved
964+
* this behavior in unit testing, we'd have to create async unit tests, which are hard to write,
965+
* to follow and to maintain. But neither can the testing mock respond synchronously; that would
966+
* change the execution of the code under test. For this reason, the mock $httpBackend has a
967+
* `flush()` method, which allows the test to explicitly flush pending requests. This preserves
968+
* the async api of the backend, while allowing the test to execute synchronously.
970969
*
971970
*
972971
* # Unit testing with mock $httpBackend

0 commit comments

Comments
 (0)