当我尝试使用$httpBackend.flush();我得到错误TypeError:$browser.cookies不是一个功能.我找不到任何关于这种错误和任何解决方案的信息.
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