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

$httpBackend.verifyNoOutstandingRequest fails to throw when digest is not triggered #13506

Closed
katemihalikova opened this issue Dec 11, 2015 · 2 comments

Comments

@katemihalikova
Copy link
Contributor

Overview of the Issue
In unit test, I use $httpBackend.verifyNoOutstandingRequest(); to make sure that no request was done. The test also passes when the request is done, because verifyNoOutstandingRequest does not trigger digest (in contrary to flush and verifyNoOutstandingExpectation) which leads to unpropagated Unexpected request error.
There is a comment asking whether calling digest should be added to verifyNoOutstandingRequest as well, but with no response.

Use Case - testing that $http request is not being done
Angular Version - 1.4.8
Reproduce the Error

    it('should not allow submitting invalid form', function() {
        var ctrl = createCtrl();
        ctrl.submit();
        $httpBackend.verifyNoOutstandingRequest();
    });
@katemihalikova katemihalikova changed the title $httpBackend.verifyNoOutstandingRequest() fails to throw when digest is not triggered $httpBackend.verifyNoOutstandingRequest fails to throw when digest is not triggered Dec 11, 2015
@gkalpak gkalpak added this to the Backlog milestone Dec 11, 2015
@gkalpak
Copy link
Member

gkalpak commented Dec 11, 2015

Sounds like a reasonable change (if nothing else, restores consistency with verfiyNoOustandingExpectations() and flush()). It will be a BC, though - might be a good candidate for v1.6.x.

@katemihalikova, would you like to take a stub at it (and see how much it breaks our testsuite 😃) ?

@katemihalikova
Copy link
Contributor Author

Will look into it soon 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants