当我尝试使用$httpBackend.flush(); 我收到错误TypeError: $browser.cookies is not a function。我找不到有关此类错误和任何解决方案的任何信息。
describe("someText", function() {
var $httpBackend;
var someManager;
var authRequestHandler;
var dataMockup = [];
beforeEach(function(){
module('app');
inject(function($injector){
$httpBackend = $injector.get('$httpBackend');
someManager = $injector.get('someManager');
authRequestHandler = $httpBackend.when('GET', 'someUrl.php')
.respond(dataMockup);
});
});
it('test first action', function() {
$httpBackend.expectGET('someUrl.php');
messageManager.loadData();
$httpBackend.flush(); // There i got error
});
});
- 角度:1.3.15
- 茉莉花:2.3.4