I have a condition where i need to mock or stub data.
var array =['add','divide']
var add =listMehtod[0];
if(add instanceof Calculator){ // how to test this ?
// some logic
}
basically i have to write some test case for inside logic, but the problem is first if statement which i am not able to pass through. is there a any way to handle it by chai or sinon ?
test case :
var a = new Calculator();
expect(a).to.be.instanceOf(Calculator) // this is returning false