I'm getting an error while performing the following test:
it('testing if the onStateChangeErrorHandle function is defined', function(){
expect(rootScope.$on).toBeDefined();
srv.onStateChangeError({$rootScope: rootScope});
});
ERROR:
TypeError: undefined is not an object (evaluating 'rootScope. $ on')
And I'm not realizing why.