You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ngMock): trigger digest in $httpBackend.verifyNoOutstandingRequest()
Firing a digest at the beginning of the verification process, ensures that requests fired
asynchronously - e.g. in the `resolve` handler of a promise as happens with `$http` - will get
detected as well.
Previously, in order to reliably verify that there was no outstanding request, users needed to
manually trigger a digest, before calling `verifyNoOutstandingRequest()`. Failing to do so, could
prevent `verifyNoOutstandingRequest()` from detecting pending requests and cover bugs in application
code.
This is no longer the case, since a digest will always be fired autommatically as part of a call to
`verifyNoOutstandingRequest()`.
Fixesangular#13506Closesangular#13513
BREAKING CHANGE:
Calling `$httpBackend.verifyNoOutstandingRequest()` will trigger a digest. This will ensure that
requests fired asynchronously will also be detected (without the need to manually trigger a digest).
This is not expected to affect the majority of test-suites. Most of the time, a digest is (directly
or indirectly) triggered anyway, before calling `verifyNoOutstandingRequest()`.
In the unlikely case that a test needs to verify the timing of a request with respect to the digest
cycle, you should rely on other means, such as mocking and/or spying.
0 commit comments