title: React component using jQuery without require - jest unit tests
body: <p>I have a very simple React mixin which uses jQuery to trigger an event</p>
  
  <pre><code>MyMixin = {
    trackStructEvent: function () {
      args = Array.prototype.slice.call(arguments);
      $('body').trigger('myEvent', args);
    }
  module.exports = MyMixin
  </code></pre>
  
  <p>This is imported into the main site as part of a new set of components using browserify. As the main site holding these components will always include jQuery, I don't want to require jQuery with browserify, as it will be duplicated.</p>
  
  <p>This isn't an issue in terms of behaviour - however it causes problems when running jest to unit test the components using this mixin throwing the error.</p>
  
  <pre><code>ReferenceError: $ is not defined
  </code></pre>
  
  <p>I know I can fix this by including jQuery through browserify, but that will load 2 copies into my site.</p>
  
  <p>Is there any way in jest to tell my react component that jQuery already exists on the window and not to worry about it?</p>