Aşağıdaki ünite testlerine sahibim ve bir sebepten dolayı ikinci test diğer testlerin başarısız olmasına neden oluyor.AngularJS Yasemin Ünitesi Testleri
beforeEach(inject(function ($rootScope, _$httpBackend_, $controller, $location, mockedResource) {
scope = $rootScope.$new();
httpBackend = _$httpBackend_;
locationService = $location;
ctrlDependencies = {
$scope: scope,
resource: mockedResource,
}
var ctrl = $controller('myController', ctrlDependencies);
}));
it('should redirect to a new page', function() {
scope.pageRedirectFunction();
expect(locationService.path()).toBe('/newpage')
});
it('should delete an epic resource', function() {
httpBackend.expectGET('/api/v1/epic/1').respond({});
httpBackend.expectDELETE('/api/v1/epic/1').respond({});
// Run the deletion function
scope.deleteEpicResource()
httpBackend.flush() // This line seems to be the rebelious one
expect(scope.epicResources.length).toEqual(0)
})
Ben hatalara neden görünüyor hattını anlamaya başarmış ve bu httpBackend.flush()
hat. Yıkama işlevi neden garip davranışlara neden oluyor?
ben terminalde komutunu karma start
çalışmasını olsun gerçek hata şöyledir: bir süre sonra
Delaying execution, these browsers are not ready: Chrome 29.0 ....
Chrome oturumu sonra çöküyor.
Ne tür bir hata yaptınız? Bu olmadan kimse bunu tahmin bile edemez. – zsong
Elbette! Ne korkunç bir hata. Hata ile güncelleniyor ... – Sneaksta
Ne olduğunu görmek için, Karma'nın günlük seviyesini, hata ayıklamak için artırmaya çalışın. – madhead