javascript - Karma AngularJs Cancel/mock Timeout E2E -


in angular have service object animates page transitions. problem animation making karma/testacular e2e tests run slowly. code looks following:

.factory('animator', function($timeout, $location, $rootscope){         return {             animate: function(animationvariable, animationtype, callback){                 $rootscope[animationvariable] = animationtype + " animated";                 $timeout(                     function(){                         $rootscope[animationvariable] = "";                         if(callback) { callback() }                     },1300)                 ;             }         }     }) 

how can mock out animation functionality skipped when running e2e tests in karma.

karma able start, unable execute tests if of source files use angular $timeout service. if wish still test application, need remove references $timeout service or write own.

source: vojta jína


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -