title: How to set a global variable to true when running JEST test cases
body: <p>In the react app, I'm using relative URLs in fetch() to send API requests to the server. This works well in browser however, when I'm running unit test cases (JEST), isomorphic-fetch throws error saying that only absolute urls are allowed. Is there any way to handle this error? I'm trying to wrap the fetch() function and use it. Something like this:</p>
  
  <pre><code>    function customNodeFetch(url, options) {
          var finalURL = (isTesting)? 'http://localhost:3000/' : url;
          return fetch(finalURL, options);
       }
  </code></pre>
  
  <p>Here, I'm not knowing how to set isTesting to true, when running test cases. I tried to put the constant in the configuration. But, it's not working.  Is there any other way to fix it?</p>