title: Jasmine failing to instantiate Angular module?
body: <p>Okay, so Im trying to implement unit tests for an AngularJS project using Jasmine 2.2.0 - and I am not able to get a basic example test working for a controller.  Any help is appreciated.</p>
  
  <p>Here is the code for the controller (the simplest one I have):</p>
  
  <pre><code>angular.module('app.alerts')
      .controller('AlertCtrl', AlertCtrl);
  
  AlertCtrl.$inject = ['$scope', 'AlertService'];
  
  function AlertCtrl($scope, AlertService) {
  
      var vm = this;
      vm.closeAlert = function(index) {
          AlertService.closeAlert(index);
      }
  
      vm.getAlertList = function() {
          return AlertService.getAlertList();
      }
  }
  </code></pre>
  
  <p>And here is the spec file I am trying to run:</p>
  
  <pre><code>describe('myApp', function() {
      describe('controller', function() {
  
          var scope, controller;
          var mockAlertService = {      // simple mock service
              closeAlert: function(e) {
                  console.log('close');
              },
              getAlertList: function() {
                  return [];
              }
          }    
  
          beforeEach(function() {
              angular.mock.module('app.alert');
          });
  
          beforeEach(inject(function($rootScope, $controller) {
              scope = $rootScope.$new();
              controller = $controller('AlertCtrl as alertctrl', {
                  $scope: scope,
                  AlertService: mockAlertService
              });
          }));
  
          it('should work: ', function() {
              expect(true).toBe(true);
          });
      });
  });
  </code></pre>
  
  <p>When I run the test I get the following error message:</p>
  
  <pre><code>Error: [$inject:modulerr] Failed to instantiate module app.alert due to:
  [$injector:nomod] Module 'app.alert' is not available! You either misspelled
  the module name or forgot to load it.
  </code></pre>
  
  <p>It seems that the injector doesn't know about the app.alert module, which means its not being properly mocked?  Im including the angular-mocks.js file in my SpecRunner.html file.  Can anybody see what Im doing wrong?</p>