vendredi 16 octobre 2020

How I test local variable declared inside function using jest

function abc(){
   let b;
   const a = document.querySelector();
   //Suppose a is calculating width 
   if(a <768){
     b = true;
   }else{
     b = false;
   }

This is just an example. Suppose I have hard-coded a value then too how can I test the function it using jest?

Aucun commentaire:

Enregistrer un commentaire