angularjs - Throw error in error function of $http causes $digest already in progress in unit test -
here plunker showing issue:
http://plnkr.co/edit/j8zrij?p=preview
here plunker error commented out in both scripts.js , scripts.spec.js , don't $digest error anymore:
http://plnkr.co/edit/jcrlwf?p=preview
throwing , testing errors seems work when not inside callback of $http request. know why might not working?
the problem mock $exceptionhandler service re-throws exceptions default. exception causing $rootscope.$apply aborted in middle.
one solution switch mock $exceptionhandlerprovider 'log' mode , check $exceptionhandler.errors. see here.
Comments
Post a Comment