title: Karma: ReferenceError: app is not defined
body: <p>I followed the tutorial from <a href="http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html" rel="nofollow">http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html</a> for testing AngularJS apps with Karma.</p>
  
  <p>My karma.conf.js looks like this:</p>
  
  <pre><code>module.exports = function(config) {
    config.set({
      basePath: '',
      frameworks: ['jasmine'],
      files: [
        'public/bower_components/angular/angular.min.js',
        'public/bower_components/angular-route/angular-route.min.js',
        'public/bower_components/d3/d3.js',
        'public/bower_components/nvd3/nv.d3.js',
        'public/bower_components/angularjs-nvd3-directives/dist/angularjs-nvd3-directives.js',
        'public/bower_components/angular-mocks/angular-mocks.js',
        'public/scripts/**/*.js',
        'test/*Spec.js'
      ],
      exclude: [
      ],
      preprocessors: {
      },
      reporters: ['progress'],
      port: 9876,
      colors: true,
      logLevel: config.LOG_INFO,
      autoWatch: true,
      browsers: ['Chrome'],
      singleRun: false
    });
  };
  </code></pre>
  
  <p>And my test:</p>
  
  <pre><code>describe("app", function() {
  
    beforeEach(angular.mock.module('app'));
  
    it('should have a HomeController', function() {
      expect(app.HomeController).not.to.equal(null);
    });
  
  });
  </code></pre>
  
  <p>public/scripts/app.js</p>
  
  <pre><code>angular.module('app', [
    'ngRoute',
    'app.controllers',
    'nvd3ChartDirectives'
  ]);
  </code></pre>
  
  <p>I get an output in the console saying: app should have a HomeController FAILED
      ReferenceError: app is not defined</p>
  
  <p>Any help would be appreciated,</p>
  
  <p>Thanks in advance!</p>