$ httpBackend.flush() işlevini kullanmaya çalıştığımda; Hata alıyorum TypeError: $ browser.cookies bir işlev değil. Bu tür bir hata ve herhangi bir çözüm hakkında hiçbir bilgi bulamıyorum. EğikJasmine ve köşeli açmaya çalıştığınızda hata oluştu
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
- Yasemin: 2.3.4
Ayrıca açısal alay dosyalarının doğru sürümüne sahip olduğunuzdan emin olun. https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular-mocks.js – PSL
@PSL, teşekkürler. Onu fark etmedim. – gregurco