title: Why do I need to register $moment with the $injector before each Jasmine test?
body: <p>So, I'm writing some Jasmine unit tests for a controller which utilizes Moment.js. Moment.js is included in app.js like so:</p>
  
  <pre><code>.config(function ($momentProvider) {
    $momentProvider
      .asyncLoading(false)
      .scriptUrl('bower_components/moment/min/moment.min.js');
  })
  </code></pre>
  
  <p>Then, I can just inject $moment into wherever. $moment isn't directly called from the controller, but some of the directives on the controlled page use it.</p>
  
  <p>Originally, the controller unit tests failed with errors like these:</p>
  
  <pre><code>Error: [$injector:unpr] Unknown provider: cProvider &lt;- c &lt;- $moment &lt;- myService &lt;- $moment
  Error: [$injector:unpr] Unknown provider: cProvider &lt;- c &lt;- $moment &lt;- $moment
  </code></pre>
  
  <p>Later, I added some code to register $moment with the $injector inside of beforeEach, as follows:</p>
  
  <pre><code>beforeEach(function(){
    module('myApp');
    module('socketMock');
  
    module(function ($provide) {
      $provide.value('$moment', moment);
    });
  });
  </code></pre>
  
  <p>I don't understand why this is necessary. I use other services in the controller (i.e. $cookieStore, $stateParams, and a whole bunch of custom services) that don't require this. Could it because those services are injected directly into the controller, but $moment is not ($moment is injected into some directives on the page, but not the controller)?</p>