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

Static methods and properties on functions aren't mocked.

jsdevel opened this issue · comments

function myFunc(){alert('yay');}
myFunc.staticMethod=function(){};
myFunc.staticProperty=5;

var spiedMyFunc = spy(myFunc);

spiedMyFunc.staticMethod();//This should work but it doesn't I.E. for libraries like jQuery
equal(spiedMyFunc.staticProperty, 5);//should equal but it's not