title: Angular unit tests: Browser is not defined?
body: <p>I'm running unit tests on a controller in an angular app. My test so far is:</p>
  
  <pre><code>describe('Controller', function () {
      var scope, ctrl;
      beforeEach(module('myApp'));
      beforeEach(inject(function ($rootScope,
                                  $controller) {
          scope = $rootScope.$new();
          ctrl = $controller('Controller', {
              $scope: scope
          });
      }));
      beforeEach(browser().navigateTo('/'));
      it('should get you to the next page', function () {
          scope.submit();
          expect(browser().location().path()).toBe('/new')
      });
  });
  </code></pre>
  
  <p>with controller</p>
  
  <pre><code>var Controller = function ($scope, $location) {
      $scope.submit = function () {
          $location.path('/new');
      }
  }
  </code></pre>
  
  <p>However, when I run this I get the error <code>browser is not defined</code>. What is going on here? Isn't this provided by Angular?</p>
  
  <p>Edit: Even stranger, I'm getting the error that <code>inject</code> is not defined.</p>
  
  <p>Here's the config file:</p>
  
  <pre><code>basePath = '../';
  
  framework = ["ng-scenario"];
  
  files = [
    ANGULAR_SCENARIO,
    ANGULAR_SCENARIO_ADAPTER,
    'http://code.jquery.com/jquery-1.9.1.min.js',
    'https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js',
    '../static/javascript/angular-mocks.js',
    '../static/javascript/angular-scenario.js',
    '../static/javascript/stripe.js',
    'templates/static/avgrund.jquery.js',
    'templates/static/chosen.jquery.js',
    'templates/static/app.js',
    'tests/E2E/tests.js'
  ];
  
  urlRoot = '/_karma_/';
  
  singleRun = true;
  
  browsers = ['Chrome'];
  
  junitReporter = {
    outputFile: 'test-output.xml',
    suite: 'e2e'
  };
  </code></pre>