angularjs - ngProgress plugin is making http calls in Jasmine unit tests -


i have situation in unit test ngprogress plugin making http calls, messing unit tests getting unexpected errors:

uncaught error: unexpected request: http://upda...

here stack grace

> request(), app.js:35 deferred.promise.then.wrappedcallback(), > angular.js:10597 deferred.promise.then.wrappedcallback(), > angular.js:10597 anonymous(), angular.js:10683 $get.scope.$eval(), > angular.js:11576 $get.scope.$digest(), angular.js:11421 > $get.scope.$apply(), angular.js:11682 updatecount(), > ngprogress.min.js:8 anonymous(), ngprogress.min.js:8 

you can mock out in unit tests redefining empty module

angular.module('ngprogress', function() {}); 

make sure testing code mocks lib out loaded browser after file defines module, or excluded ngprogress file loading altogether.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -