andCallThrough() fails?

438 views
Skip to first unread message

Maximilian Noppel

unread,
Dec 4, 2014, 8:10:30 AM12/4/14
to jasmi...@googlegroups.com
Why does this code fails
it("Test", inject(function (){
var obj = {
func: function (){
}
};
spyOn(obj, "func").andCallThrough();
}));

with this exception?
TypeError: 'undefined' is not a function (evaluating 'spyOn(obj, "func").andCallThrough()')
   at /home/max/thesis/projekt/src/CurrentAdService.spec.js:44
            ...

I did update some packages via npm and now it is not working. I forget to make a backup of my package.json. Here are the Versions, i tried till now:
jasmine 2.1.1, jasmine-core 2.1.3
jasmine 2.0.1, jasmine-core 2.0.1

Both combination dont work.
Thanks,
Max

Greg Cobb

unread,
Dec 4, 2014, 5:18:47 PM12/4/14
to jasmi...@googlegroups.com
In Jasmine 2 the syntax changed to 'spy.and.callThrough()'. See the docs for more info. For a full Jasmine 2 upgrade guide see this.

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages