title: Error: [$injector:unpr] Unknown provider: in AngularJS Service Test
body: <p>I am having a lot of trouble getting dependencies provided properly for an AngularJS service.</p>
  
  <p>I see a number of other posts with similar errors here on StackOverflow but none of them seem to resolve the issue.</p>
  
  <p>Here is the app code:</p>
  
  <pre><code>cm.modules.app = angular.module('myApp', ['ngRoute', 'ngAnimate']);
  myServiceName = function($http) {
      // do stuff
  };
  myServiceName.prototype.value = 1;
  
  cm.modules.app.service('defaultAlertFactoryA', myServiceName);
  </code></pre>
  
  <p>Here is the test code:</p>
  
  <pre><code>describe('test alertFactoryA', function() {
    var $provide;
    var mAlertFactoryA;
  
    beforeEach(module(cm.modules.app));
  
    beforeEach(angular.mock.module(function(_$provide_) {
      $provide = _$provide_;
    }));
  
    beforeEach(function() {
      inject(function($injector) {
        mAlertFactoryA = $injector.get('defaultAlertFactoryA');
      });
    });
  
    it('should work', function() {
      expect(true).toBe(true);
    });
  });
  </code></pre>
  
  <p>Here is the error:</p>
  
  <blockquote>
    <p>Error: [$injector:unpr] Unknown provider: defaultAlertFactoryAProvider
    &lt;- defaultAlertFactoryA
    <a href="http://errors.angularjs.org/1.2.0-rc.2/" rel="noreferrer">http://errors.angularjs.org/1.2.0-rc.2/</a>$injector/unpr?p0=defaultAlertFactoryAProvider%20%3C-%20defaultAlertFactoryA</p>
  </blockquote>
  
  <p>Question: How do I fix this so the test passes?</p>