jeudi 31 mars 2016

Jasmine to test window.setTimeout

I have the following code which I need to test using jasmine and I seem to be stuck

timeoutCallback () {
var self = this;
self.$window.setTimeout(function() {
  self.$window.location.href = 'www.google.com';
}, 400);
}

I keep on getting the following error in my existing jasmine test which call the callback

'undefined' is not a function (evaluating 'self.$window.setTimeout(function () {
    self.$window.location.href = 'www.google.com';
  }, 400)') (line 183)




Aucun commentaire:

Enregistrer un commentaire