I have one Jasmine test that constantly fails due to lack of spyOn .
The following test will fail automatically:
it('simple test', function() { spyOn(angular, 'element'); });
Error:
TypeError: 'undefined' is not an object (evaluating 'angular.element(handle.elem).off') at /Users/geoff/Project/www/components/angular-mocks/angular-mocks.js:1946 at /Users/geoff/Project/www/components/angular-mocks/angular-mocks.js:1977
This error only occurs with angular.element . spy ing for other angular methods like angular.copy and angular.forEach , do not throw this error. I am using Jasmine 2.0 and Angular ~ 1.3. Any tips to fix this problem will be appreciated.
geoff source share