title: How to include a file from the web in a jest test
body: <p>I have a script I'm testing, which relies on other scripts that are included within the html page header.  When testing a module with jest, these files are never fetched, I was wondering how to include them in the test so my modules have access to the functions they need to run.</p>
  
  <p>example html:</p>
  
  <pre><code>&lt;script src="http://example.com/my.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>jest test:</p>
  
  <pre><code>jest.unmock('../addeditCreditModal.jsx');
  jest.unmock('../../../utils/dataPreprocessor.js');
  var $ = require("../../../../../../jquery.min.js");
  describe('ADDEDIT', () =&gt; {
      const AE = require('../addeditCreditModal.jsx').default;
      const React = require('react');
      const ReactDOM = require('react-dom');
      const TestUtils = require('react-addons-test-utils');
  
      it('add edit', () =&gt; {
          window.$ = require("../../../../../../jquery.min.js");
          //here I need to include a file, bcuase functions will be called when mounting the module, like jquery, which is on my machine, but the web file is not.
          //importScripts("http://example.com/my.js");
          const landing = TestUtils.renderIntoDocument(
              &lt;AE 
                  closeModal={jest.genMockFn()} 
              /&gt;
          );
      });
  });
  </code></pre>
  
  <p>The java script I want to include is not a module, just generic java script attaching functions to the window.</p>