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
This commit is contained in:
thenickcox
2013-11-11 08:30:32 -08:00
committed by Pawel Kozlowski
parent 3a8bbb721d
commit 3248233f5e

View File

@@ -960,13 +960,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, understand, and maintain. However, 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 preserve 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