jeudi 25 juin 2015

AngularJS & Karma-Jasmine - Not working if verifyNoOutstandingExpectation(); or verifyNoOutstandingRequest(); stands alone

I have one http request that has not been flushed, so when I have it like this

afterEach(function(){
      $httpBackend.verifyNoOutstandingExpectation();
      $httpBackend.verifyNoOutstandingRequest();
});

It works as expected and I get

Error: Unflushed requests: 1

The error message comes from $httpBackend.verifyNoOutstandingRequest();, but when I have it like this

afterEach(function(){
    $httpBackend.verifyNoOutstandingRequest();
});

No error is thrown.

Why is it so ? Do I have to alwys keep the both method together ?

Aucun commentaire:

Enregistrer un commentaire