I have a Javascript function in a view that is enclosed in a closure. Closing returns a function with the same name, and also has some helpers. This is the structure of the method.
this.myMethod = (function () {
function helperMethod(){
....
return true;
}
return function myMethod(args){
helperMethod();
manipulate();
}
}
My question is how to write this Jasmine Unit Test method. How can I call this method?
Using the default method of methods in this case does not work, because it is anonymous.
var view = new myView();
view.myMethod();
expect ( true ).toBeTruthy();
Please help with this. I am new to the Jasmine Framework.
source
share