title: Unit testing with Webpack, Jasmine (-core), typescript
body: <p>I have a project that is using webpack to bundle all code into a single file.  The project is using Typescript and it is working fine at the moment.</p>
  
  <p>I've gone to add unit testing and jasmine seems to be the way (one of the many ways) forward.  Its actually jasmine-core that is included in the package.json - not sure how much of a difference that makes.</p>
  
  <p>So running a very simple test such as </p>
  
  <pre><code>it('true is true', function(){ expect(true).toEqual(true); });
  </code></pre>
  
  <p>works fine.
  But when I add tests that require the use of an import - eg</p>
  
  <pre><code>import MyService = require('./MyServices');
  </code></pre>
  
  <p>then when I run the tests it complains as it doesn't know what 'require' is.
      <code>Uncaught ReferenceError: require is not defined</code></p>
  
  <p>Now I'm guessing this is because I need to package up the test module in a similar way that I package up the main project.</p>
  
  <p>So what is the best way to do this?
  Should I have multiple entry points in the webpack.config.js file - one for each *.spec.ts file? 
  Or is there a way to have say accept an unknown number of spec files</p>
  
  <p>entry:[ *.spec.ts ] and have it output a js file for each one - *.spec.js</p>