My js script has something like this.
<code> window.object_name = {
//defined function
testFunction: function(arg1,arg2){
}
testFunction_2 : function(){
//calling testFunction in anotherfunction using 'this' keyword
this.testFunction();
}
}
</code>
<code> window.object_name = {
//defined function
testFunction: function(arg1,arg2){
}
testFunction_2 : function(){
//calling testFunction in anotherfunction using 'this' keyword
this.testFunction();
}
}
</code>
window.object_name = {
//defined function
testFunction: function(arg1,arg2){
}
testFunction_2 : function(){
//calling testFunction in anotherfunction using 'this' keyword
this.testFunction();
}
}
calling testFunction in anotherfunction using ‘this’ keyword but while running test cases this does not have reference of testFunction
Tried to mock this keyword or redefining does not work.
Will be thankful for any leads. Thank you!!