title: How to test if condition using jest
body: <p>I am new to react and not able to find how can i get the code coverage done for my below mentioned function using jest.</p>
  
  <p>For the sake of clarity I have created a function just similar to what I am using :</p>
  
  <pre><code>setName: function setName () {
    var storage = localStorage.getItem(user);
    var session = sessionStorage.getItem(temp);
  
    if ((session === null || session === undefined) &amp;&amp; (storage === null &amp;&amp; storage === undefined)) {
      var name = "window.name";
  
      if (name  === 'John') {
        changeName(name);
      } else if (name === 'Jane') {
        changeName(name);
      } else if (name  === 'Mark') {
        changeName(name);
      } else {
        changeName('John');
      }
    } else if (session !== null) {
      changeName(session);
    } else if (storage !== null) {
      changeName(storage);
    }
  }
  </code></pre>
  
  <p>Any help is appreciated</p>