title: Using angular.mock.inject in karma gives "TypeError: Cannot read property '$injector' of null"
body: <p>I am trying to do some basic Unit testing for AngularJS using Karma. All the tests I have written seem syntactically correct. But I am having a problem at the most basic step, i.e the beforeEach part of the code. When I try running the test, I get the following problem </p>
  
  <pre><code>TypeError: Cannot read property '$injector' of null
  at Object.workFn (http://localhost:9876/absolute/Users/vesriram/Documents/AngularJS%20project/vendor/js/angular-mocks.js:1698:15)
  at Object.&lt;anonymous&gt; (http://localhost:9876/adapter/lib/angular-scenario.js:26360:54)
  at Array.forEach (native)
  at Object.forEach (http://localhost:9876/adapter/lib/angular-scenario.js:9593:11)
  </code></pre>
  
  <p>I have been trying to solve this problem for the past 36 hours and have had no luck so far. As far as I can see, noone else seems to be having this problem. This makes me think that I am possibly doing something stupid. I would really appreciate any help you people could give me. I will be happy to post any additional code that you need (so long as I am at liberty to divulge it).</p>
  
  <p>The relevant code is the following- </p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var sell_page = angular.module("sell_page", ['ui.bootstrap']);
  
  sell_page.controller('ItemTitleController', ['$scope','listingInformationService', '$location',function($scope, listingInformationService, $location) {
      $scope.itemNames = getAllItemNames();
      $scope.draftItems = getAllSavedDrafts();
      document.getElementById("categorySelection").style.visibility = "hidden";
  
      ------bunch of code-------
  }]); 
  </code></pre>
  
  <p><strong>controllersSpec.js</strong> </p>
  
  <pre><code>describe("Unit: Testing Controllers", function() {
  
  beforeEach(angular.mock.module('sell_page'));
  
  it('should have a ItemTitleController controller', function() {
      expect(sell_page.ItemTitleController).not.to.equal(null);
  });
  
  
  describe("ItemTitleController", function() {
      var scope;
      beforeEach(angular.mock.module('sell_page'));
      beforeEach(angular.mock.inject(function($rootScope, listingInformationService, $location, $controller) {
          var scope = $rootScope.$new();
          var controller = $controller('ItemTitleController', {
              $scope : scope
          });
      }));
  
      it("should display xxx properly", function() {
          --some code---
      });
  
  });
  </code></pre>
  
  <p><strong>karma.conf.js</strong></p>
  
  <pre><code>basePath = '';
  
  files = [
     JASMINE,
     JASMINE_ADAPTER,
     '../vendor/js/angular.min.js',
     '../vendor/js/angular.js',
     '../vendor/js/angular-mocks.js',
     '../vendor/js/angular-scenario.js',
     ANGULAR_SCENARIO,
     ANGULAR_SCENARIO_ADAPTER,
     '../app/js/*.js',
     'e2e/*.js',
     'midway/*.js',
     'unit/*.js',    
  ];
  
  exclude = [
  ];
  
  reporters = ['progress'];
  port = 9876;
  runnerPort = 9100;
  colors = true;
  logLevel = LOG_INFO;
  autoWatch = true;
  browsers = ['Chrome'];
  captureTimeout = 60000;
  singleRun = false;
  </code></pre>