mercredi 27 mai 2015

Using Sinon to spy on variables in a function

Suppose I have a function as follows

function fun1(a) {
  var local_a = a;
  local_a += 5;
  return local_a/2;
}

Is there a way to test for the value of local_a being what it should be (for example in the first line of code)?

Aucun commentaire:

Enregistrer un commentaire