While using andCallFake
function in Jasmine unit test, I am getting this error :
TypeError: jasmine.createSpy(...).andCallFake is not a function
What can be missing?
While using andCallFake
function in Jasmine unit test, I am getting this error :
TypeError: jasmine.createSpy(...).andCallFake is not a function
What can be missing?
It should be
spyOn(target, 'method').and.callFake(...);
jasmine.createSpy().and.callFake(...); // alternatively
There is a dot between and
and callFake
. As the documentation states
Regards