How to write a test case for a function which doesn't return anything but having some logic / calculation depends on global variable values. I am using jasmine framework to write test cases for JavaScript functions.
var a = 10, b = 20, c = 0; //a and b variables holds dynamic values
function add(){
c = a + b;
}
In above case How to write test case for add() function using jasmine?
Aucun commentaire:
Enregistrer un commentaire