0
저는 서버 측에서 테스트 meanjs를 가진 초보자입니다. 소개 HTTP를 수행하는 팩토리를 호출하는 서비스를 만들었습니다. 그래서 이해하고 싶은 이유를이 오류 :mean.js 예기치 않은 요청 : 이미지를 얻으십시오.
Unexpected request: GET images No more request expected at $httpBackend (/home/developer/mcd2/public/lib/angular-mocks/angular-mocks.js:1181)
-----MOCK-----
beforeEach(inject(function($controller, $rootScope, _$location_, _$stateParams_, _$httpBackend_,$filter,_Images_) {
// Set a new global scope
scope = $rootScope.$new();
// Point global variables to injected services
$stateParams = _$stateParams_;
$httpBackend = _$httpBackend_;
}
it('Test that takes the complete list of all the images in the DB (Images.get)',inject(function (ImagesREST) {
var Image = new ImagesREST({
namefile: 'Image_1',
width: 123,
height : 321,
extension : 'JPG',
tag : 'pippo',
size:9998,
type:'img/jpg',
path:'/asd/add',
rel:'/asd/Immagine1',
lastModified:new Date()
});
var arrayImages=[Image];
$httpBackend.expectGET('images').respond(arrayImages);
var lista = Images.get();
$httpBackend.flush();
console.log(lista);
}));
감사합니다!