title: webpack require non-js content in jest unit-tests
body: <p>Recently I've converted one of my projects to webpack &amp; babel. It is made out of knockout components.</p>
  
  <p>I'm running into a problem while running the unit-tests. If I have a file in the  <strong>tests</strong> folder like </p>
  
  <pre><code>import component from '../custom-options';
  
  test('adds 1 + 2 to equal 3', () =&gt; {
    expect(3).toBe(3);
  });
  </code></pre>
  
  <p>The problem is that the component is a module which has a require of the sort </p>
  
  <pre><code>var htmlString = require('./custom-options.html');
  </code></pre>
  
  <p>When I try to run the website itself it runs fine, as the raw loader is configured for this require. However, when I run jest the test outputs:</p>
  
  <pre><code> custom-options.html:1
   ({"Object.&lt;anonymous&gt;":function(module,exports,require,__dirname,__filename,global,jest){?&lt;div id="custom-options-containe" class="mod--custom-options"&gt;
                                                                                            ^
  SyntaxError: Unexpected token &lt;
  
    at transformAndBuildScript (node_modules\jest-cli\node_modules\jest-runtime\build\transform.js:284:10)
    at custom-options.js:13:38
    at Object.&lt;anonymous&gt; (custom-options.js:93:3)
  </code></pre>
  
  <p>Any idea why this is happening? I thought jest was at fault but I've tried subbing it out with Ava and the result is the same. I'm beginning to think it's a babel problem. </p>
  
  <p>I'm running jest with the babel-jest preprocessor.</p>