title: Module is not a function - Karma + jasmine + webpack + angular
body: <p>I have a simple angular (1.2.24) app and I have my unit test in Jasmine and I use Karma and webpack.</p>
  
  <p>When I execute karma I get issue with this line of code in my unit test</p>
  
  <pre><code>beforeEach(module('Test'));
  </code></pre>
  
  <p>The error I get is </p>
  
  <pre><code>TypeError: module is not a function
      at Suite.&lt;anonymous&gt; (tests.webpack.js:77:14)
      at Object.&lt;anonymous&gt; (tests.webpack.js:75:48)
      at Object.&lt;anonymous&gt; (tests.webpack.js:94:31)
      at __webpack_require__ (tests.webpack.js:20:30)
      at webpackContext (tests.webpack.js:58:10)
      at Array.forEach (native)
      at Object.&lt;anonymous&gt; (tests.webpack.js:48:17)
  </code></pre>
  
  <p>Here is my <strong>karma.config.js</strong></p>
  
  <pre><code>var webpack = require('webpack');
  
  module.exports = function (config) {
    config.set({
      browsers: [ 'Chrome' ], //run in Chrome
      plugins: [
              'karma-jasmine',
              'karma-webpack',
              'karma-chrome-launcher'
  
          ],
      singleRun: true, //just run once by default
      frameworks: [ 'jasmine' ], //use the mocha test framework
      files: [
        'tests.webpack.js', //just load this file
        'TestBuild/Scripts/angular.js',
        'TestBuild/Scripts/ui-router.js'
      ],
      preprocessors: {
        'tests.webpack.js': [ 'webpack' ] //preprocess with webpack and our sourcemap loader
      },
      reporters: [ 'dots' ], //report results in this format
      webpack: { //kind of a copy of your webpack config
        devtool: 'inline-source-map', //just do inline source maps instead of the default
        module: {
          loaders: [
            { test: /js-tests\/\.js$/ , loader: 'babel-loader'}
          ]
        }
      },
      webpackServer: {
        noInfo: true //please don't spam the console when running in karma!
      }
    });
  };
  </code></pre>
  
  <p><strong>tests.webpack.js</strong></p>
  
  <pre><code>var context = require.context('./js-tests', true, /\.js$/); 
  context.keys().forEach(context);
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>"main": "karma.conf.js",
    "dependencies": {
      "jasmine": "^2.5.0",
      "karma": "^1.2.0",
      "karma-chrome-launcher": "^2.0.0",
      "karma-webpack": "^1.8.0",
      "webpack": "^1.13.2",
      "jasmine-core": "^2.5.0",
      "karma-jasmine": "^1.0.2"
    },
    "devDependencies": {
      "babel-core": "^6.14.0",
      "jasmine-core": "^2.5.0",
      "karma-cli": "^1.0.1",
      "karma-jasmine": "^1.0.2"
    },
  </code></pre>
  
  <p>I've tried the solution at <a href="https://stackoverflow.com/questions/32499108/karma-jasmine-webpack-module-is-not-a-function">karma + jasmine + webpack: module is not a function</a> and it doesn't help.</p>
  
  <p>Kindly let me know how i can fix this issue. Thanks in advance.</p>