title: Setting up Karma with Angular, Babel (ES6), Webpack and Mocha
body: <p>I'm trying to setup Karma on a project with Angular. The error I'm currently receiving is:</p>
  
  <p><em>Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
    <a href="http://errors.angularjs.org/1.4.7/" rel="nofollow">http://errors.angularjs.org/1.4.7/</a>$injector/nomod?p0=app
    at /htdocs/src/javascript/app/controllers/fixedQuoteFormController_test.js:2073</em></p>
  
  <p>What I'm trying to accomplish is just initial setup since I have no tests obviously. It doesn't seem to like my module.export for the controller. Any help on how I can get this setup working would be appreciated!</p>
  
  <p><strong>My Karma.conf file:</strong></p>
  
  <pre><code>// Karma configuration
  // Generated on Tue Nov 17 2015 13:05:37 GMT-0600 (CST)
  
  module.exports = function (config) {
    config.set({
  
  // base path that will be used to resolve all patterns (eg. files, exclude)
  basePath: '',
  
  // frameworks to use
  // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
  frameworks: ['mocha', 'chai'],
  
  plugins: [
    require("karma-webpack"),
    require("karma-mocha"),
    require("karma-phantomjs-launcher"),
    require("karma-chai")
  ],
  
  // list of files / patterns to load in the browser
  files: [
    'node_modules/angular/angular.js',
    'node_modules/angular-mocks/angular-mocks.js',
    'src/javascript/app/**/*_test.js',
    'src/javascript/app/**/**/*_test.js'
  ],
  
  // list of files to exclude
  exclude: [
  ],
  
  // preprocess matching files before serving them to the browser
  // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  preprocessors: {
    // add webpack as preprocessor
    'src/javascript/app/*_test.js': ['webpack'],
    'src/javascript/app/**/*_test.js': ['webpack']
  },
  
  webpack: {
    // karma watches the test entry points
    // (you don't need to specify the entry option)
    // webpack watches dependencies
    // webpack configuration
  },
  
  webpackMiddleware: {
    // webpack-dev-middleware configuration
    // i. e.
    noInfo: true
  },
  
  // test results reporter to use
  // possible values: 'dots', 'progress'
  // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  reporters: ['progress'],
  
  // web server port
  port: 9876,
  
  // enable / disable colors in the output (reporters and logs)
  colors: true,
  
  // level of logging
  // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  logLevel: config.LOG_INFO,
  
  // enable / disable watching file and executing tests whenever any file changes
  autoWatch: true,
  
  // start these browsers
  // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  browsers: ['PhantomJS'],
  
  // Continuous Integration mode
  // if true, Karma captures browsers, runs the tests and exits
  singleRun: false,
  
  // Concurrency level
  // how many browser should be started simultanous
  concurrency: Infinity,
    })
  }
  </code></pre>
  
  <p><strong>My test file:</strong> (just trying to require controller)</p>
  
  <pre><code>const testCont = require('./testCont');
  </code></pre>
  
  <p><strong>My Controller</strong></p>
  
  <pre><code>module.exports = angular.module('app').controller('testCont', testCont);
  
  /* @ngInject */
  function testCont() {
      return 1;
  }
  </code></pre>