4

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?

yankee
  • 38,872
  • 15
  • 103
  • 162
Kate
  • 71
  • 2
  • 6

1 Answers1

4

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

cnexans
  • 975
  • 1
  • 7
  • 20