cleishm / jsmockito

Javascript mocking framework inspired by the awesome mockito

Home Page:http://jsmockito.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mocking a constructor doesn't give access to methods without using call or apply.

jsdevel opened this issue · comments

Observe:

function Test(){
   this.test=function(){
   };
}
var test = mock(Test);
console.log(when(test).test);

This returns the following in my console:

{call:[Function], apply:[Function]}

Any idea why?

This library is very amazing BTW. Thanks a bunch for it!

The fix for issue #23 resolved this issue for me.