dimanche 19 juillet 2020

testing outer function and/or inner functions

In unit testing; if I have the following:

function inner1() {}
function inner2() {}
function inner3() {}


function outer() {
  const res1 = inner1();
  const res2 = inner2();
  const res3 = inner3();
  
  return res1+res2+res3;
}

Should I test every individual inner function plus the outer? or should testing the outer function be enough?
because for what I think, testing the inner functions will just be just redundant work.

Side note: I don't care about code coverage if it doesn't add real value.

Aucun commentaire:

Enregistrer un commentaire