title: karma and jasmine configuration for typescript in angular 6
body: <p>I have a simple application components in angular 6. I configure my webpack for dev and prod built and both are working fine. I am trying to configure a unit test env using karma, jasmine for my app and was not successful since yesterday. I just need to execute unit test with cocverage no e2e. Install my karma and jasmine. I then went through the karma init which generated the file below.</p>
  
  <p>// Karma configuration</p>
  
  <pre><code>module.exports = function(config) {
    config.set({
  
      // base path that will be used to resolve all patterns (eg. files, exclude)
      basePath: '',
  
      frameworks: ['jasmine'],
  
      files: [
        'src/index.ts',
        'src/**/**.spec.ts'
      ],
      mime: {
        'text/x-typescript': ['ts','tsx']
      },
  
      // list of files / patterns to exclude
      exclude: [
      ],
      preprocessors: {
      },
  
      reporters: ['progress'],
      port: 9876,
  
  
      // enable / disable colors in the output (reporters and logs)
      colors: true,
  
  
      logLevel: config.LOG_INFO,
      autoWatch: true,
      browsers: ['Chrome']
      singleRun: false,
      concurrency: Infinity
    })
  }
  </code></pre>
  
  <p>I then added a simple .spec.ts test in a component called mycomponent.spec.ts</p>
  
  <pre><code>describe('example test', function () {
      it('should be true', function () {
          expect('foo').toBe('foo');
      });
  });
  </code></pre>
  
  <p>When i run my test , i get the error below.</p>
  
  <blockquote>
    <p>Chrome 67.0.3396 (Windows 7 0.0.0) ERROR   {
        "message": "An error was thrown in afterAll\nUncaught SyntaxError: Unexpected token export",
        "str": "An error was thrown in afterAll\nUncaught SyntaxError: Unexpected token export"   } Chrome 67.0.3396 (Windows 7 0.0.0):
    Executed 1 of 1 ERROR (0.013 secs / 0.001 secs)</p>
  </blockquote>
  
  <p>I have been trying to fix this and set up  my environment since yesterday. I came across a suggestion for using karma-typescript. However, i get a lot of webpack error when i use it. Please how do i set this up ? Any help would be appreciated.</p>