Ho un test Jasmine che sta continuamente fallendo a causa di un spyOn
non in esecuzione.Impossibile spiare su angular.element
Il seguente test verrà automaticamente venga meno
it('simple test', function() {
spyOn(angular, 'element');
});
L'errore è:
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
Questo errore sembra accadere solo con angular.element
. spy
su altri angular
metodi come angular.copy
e angular.forEach
non lanciare questo errore. Sto usando Jasmine 2.0 e Angular ~ 1.3. Qualche consiglio su come risolvere questo problema sarebbe apprezzato.
Potresti ricostruire il tuo problema in un plunkr o jsFiddle? – Jan