title: How can I mock dependencies for unit testing in RequireJS?
body: <p>I have an AMD module I want to test, but I want to mock out its dependencies instead of loading the actual dependencies. I am using requirejs, and the code for my module looks something like this:</p>
  
  <pre><code>define(['hurp', 'durp'], function(Hurp, Durp) {
    return {
      foo: function () {
        console.log(Hurp.beans)
      },
      bar: function () {
        console.log(Durp.beans)
      }
    }
  }
  </code></pre>
  
  <p>How can I mock out <code>hurp</code> and <code>durp</code> so I can effectively unit test?</p>