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
Post a Comment