Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expected spy unknown to have been called

Tags:

jasmine

I'm new to Jasmine, and am getting this error:

Expected spy unknown to have been called.

What does this mean? I'm spying on a method, but am not sure what unknown means.

like image 206
Brad Parks Avatar asked Dec 05 '22 11:12

Brad Parks


1 Answers

The answer is really simple! The spy didnt have a name, so it's called "unknown" by default.

To name it, I simply did this

var mySpy = jasmine.createSpy("JamesBond");

Then it failed with something more readable!

Expected spy JamesBond to have been called.
like image 110
Brad Parks Avatar answered Mar 29 '23 14:03

Brad Parks