I have one Jasmine test that is continously failing due to a spyOn
not executing.
The following test will automatically fail:
it('simple test', function() {
spyOn(angular, 'element');
});
The error is:
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 seems to happen with angular.element
. spy
ing on other angular
methods such as angular.copy
and angular.forEach
do not throw this error. I am using Jasmine 2.0 and Angular ~1.3. Any advice on fixing this problem would be appreciated.