"Define is not defined" in Jest when testing es6 module with RequireJS dependency : <p>I have a Jest test suite that fails to run because the component it's trying to test depends on a RequireJS module. Here's the error I'm seeing:</p>

<pre><code> FAIL  __tests__/components/MyComponent.test.js
  ● Test suite failed to run

    ReferenceError: define is not defined

      at Object.&lt;anonymous&gt; (node_modules/private-npm-module/utils.js:1:90)
</code></pre>

<p>The component has the following import:</p>

<pre><code>import utils from 'private-npm-module';
</code></pre>

<p>And the <code>private-npm-module</code> is set up like so:</p>

<pre><code>define('utils', [], function() {
  return {};
});
</code></pre>

<p>When <code>MyComponent</code> is transpiled with babel and run in the browser, the dependency operates correctly. This issue only affects the unit test. How can I get my test suite to run on a component with a RequireJS dependency?</p>

<p>I'm using <code>babel-jest</code> as my <code>scriptPreprocessor</code> in package.json's jest config. I'm using jest v0.15.1.</p>
