My question is very simple unlike
afterEach (function () {
$httpBackend.verifyNoOutstandingExpectation ();
$httpBackend.verifyNoOutstandingRequest ();
});
why $httpBackend.flush()
cant be placed inside afterEach(function(){}
??
Because when I have several test cases, every time I need to call it.
describe("test1", function(){
it('1', function(){
$httpBackend.flush()
})
it('2', function(){
$httpBackend.flush()
})
it('3', function(){
$httpBackend.flush()
})
})
Even I tried to put $httpBackend.flush()
inside after each block , but I started getting error " Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
".
Is there any other way there by I can have only one block to be automatically get executed after every function for $httpBackend.flush()
Thanks