title: How can I get Karma + Webpack to find the module?
body: <p>I want to run my tests on a bunch of modules after webpack has combined them together through the Karma test runner, but whenever I run my tests Karma says, </p>
  
  <blockquote>
    <p>"Error: Cannot find module "hello.js" at
    <a href="http://localhost:9877/base/src/hello.spec.js?d301966ffc1330826574d9d8fff5a644c3390c68:47" rel="nofollow noreferrer">http://localhost:9877/base/src/hello.spec.js?d301966ffc1330826574d9d8fff5a644c3390c68:47</a>"</p>
  </blockquote>
  
  <p>I have a spec file:</p>
  
  <pre><code>var a = require('hello.js');
  
  describe("a test test", function() {
  
    it("humperdink test", function() {
      expect(a).toEqual('humperdink');
    }); //end it
  
  }); //end describe
  </code></pre>
  
  <p>hello.js is this:</p>
  
  <pre><code>var a = 'humperdink';
  
  module.exports = a;
  </code></pre>
  
  <p>Both of these files are in the same folder. </p>
  
  <p>My karma.conf.js is:</p>
  
  <pre><code>module.exports = function (config) {
    config.set({
      frameworks: ['jasmine'],
      files: [
        'src/**/*.js',
        'tests/**/*.spec.js'
      ],
      preprocessors: {
        'tests/**/*.spec.js': ['webpack'],
        'src/**/*.js' : ['webpack']
      },
      browsers: ['PhantomJS'],
      webpack: {
        entry: './src/hello.spec.js',
        output: {
          filename: 'bundle.js'
        }
      },
      webpackMiddleware: {
        noInfo: true
      }
    })
  };
  </code></pre>
  
  <p>Currently my devDependencies installed are</p>
  
  <pre><code>"devDependencies": {
      "jasmine-core": "^2.3.4",
      "jshint": "^2.8.0",
      "karma": "^0.13.15",
      "karma-jasmine": "^0.3.6",
      "karma-jshint-preprocessor": "0.0.6",
      "karma-phantomjs-launcher": "^0.2.1",
      "karma-webpack": "^1.7.0",
      "phantomjs": "^1.9.19",
      "sinon": "^1.17.2",
      "webpack": "^1.12.9"
  </code></pre>
  
  <p>How do I get Karma to find the hello.js module?</p>
  
  <p>I've tried changing the spec file's first line to things like</p>
  
  <pre><code>require('hello.js');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>require('./hello.js');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>require('hello');
  </code></pre>
  
  <p>on the advice of <a href="https://stackoverflow.com/questions/33152927/karma-webpack-error-cannot-find-module-test-utilities-js">Karma Webpack - Error: Cannot find module &quot;./test/utilities.js&quot;</a></p>
  
  <p>I don't think there's anything too complicated going on here like, <a href="https://stackoverflow.com/questions/32860762/cannot-find-module-error-when-using-karma-webpack">Cannot find module error when using karma-webpack</a>.</p>
  
  <p>I have checked to make sure that the Karma test runner is working otherwise. If I run a really simple test in its own file it works just fine.</p>
  
  <p>How do I solve this problem?</p>