title: Jest returns "Network Error" when doing an authenticated request with axios
body: <p>This seems a bit weird to me. I'm trying to test an actual (ie. real network) request with Jest.</p>
  
  <p>These are the tested scenarios:</p>
  
  <ul>
  <li>Test an external API (fixer.io) with no headers   <strong>&lt;--- This works</strong></li>
  <li>Test a local API server with headers   <strong>&lt;--- This does NOT work</strong></li>
  <li>Test same local API with headers from <code>node</code> terminal  <strong>&lt;--- This works</strong></li>
  </ul>
  
  <p>What could be the reason behind this behavior? And what is the solution?</p>
  
  
  
  <pre><code>//This WORKS
  test('testing no headers', () =&gt; {
    return axios.get('http://api.fixer.io/latest')
          .then( res =&gt; console.log(res) )
  });
  
  //This DOES NOT work
  test('testing no headers', () =&gt; {
    return axios.get('http://localhost:3000/users/4/profile', 
                        {headers:{authorization:`Bearer ${mytoken}`}})
          .then( res =&gt; console.log(res) )
  });
  
  //...
  
  //Node Terminal
  //This WORKS
  &gt; axios.get('http://localhost:3000/users/4/profile', 
                     {headers:{authorization:`Bearer ${mytoken}`}})
          .then( res =&gt; console.log(res) )
  </code></pre>