title: Karma + Typescript -> es6
body: <p>Trying to setup karma to unit test my ES6 transpiled code.  The full tool chain is:  Typescript -> ES6 -> Babel -> browserify.</p>
  
  <p>Outside of Karma I have this chain working fine (using Gulp).</p>
  
  <p>With my Karma setup I'm getting errors on the Typescript step:</p>
  
  <blockquote>
    <p>error TS2318: Cannot find global type 'IterableIterator'.
    12 03 2016 16:52:09.323:ERROR [preprocessor.typescript]: error TS2318: Cannot find global type 'Iterator'.</p>
    
    <p>error TS2318: Cannot find global type 'Iterator'.
    12 03 2016 16:52:09.323:ERROR [preprocessor.typescript]: error TS2318: Cannot find global type 'Symbol'.`</p>
  </blockquote>
  
  <p>Here's my karma.conf</p>
  
  <pre><code>module.exports = function(config) {
   config.set({
  
  // base path, that will be used to resolve files and exclude
  basePath: '',
  
  
  // frameworks to use
  frameworks: ['browserify','jasmine'],
  
  preprocessors: {
      'src/**/test.ts' : ['typescript', 'babel', 'browserify'],
      'tests/**/tests.spec.js' : ['babel', 'browserify']
   },
  
  typescriptPreprocessor: {
    options: {
      target: 'es6'
      }
   },
  
  babelPreprocessor: {
    options: {
      presets: ['es2015'],
      sourceMap: 'inline'
    }
  }, 
  
  browserify: {
     debug:true
  },
  
  files: [
     'src/**/test.ts',
     'tests/**/*.js'
   ],
  
  // list of files to exclude
  exclude: [
  
  ],
  
  
  // test results reporter to use
  // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
  reporters: ['progress'],
  
  
  // web server port
  port: 9876,
  
  
  plugins: [
  'karma-typescript-preprocessor',
  'karma-babel-Preprocessor',    
  'karma-browserify',
  'karma-jasmine',
  'karma-firefox-launcher',
  'karma-chrome-launcher'
  ],
  
  // enable / disable colors in the output (reporters and logs)
  colors: false,
  
  
  // 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,
  
  browsers: ['Chrome'],
  
  // If browser does not capture in given timeout [ms], kill it
  captureTimeout: 60000,
  
  
  // Continuous Integration mode
  // if true, it capture browsers, run tests and exit
  singleRun: false
   });
  };
  </code></pre>
  
  <p>And here's my test.ts file:</p>
  
  <pre><code>"use strict"
  function thisIsAtest(myParam:string) {
    const pi = 3.14;
  
   }
  </code></pre>
  
  <p>New to Typescript and my google powers are failing me ):</p>
  
  <p><strong>Update:</strong>   So the above configuration makes use of the babel and typescript karma <em>preprocessors</em>.   I am still unable to get that toolchain to work.   But I was able accomplish my end goal by having karma-browserify handle the transformations directly.   So my browserify section now looks like this:</p>
  
  <pre><code>browserify: {
      debug: true,
      plugin: ['tsify'],
      transform: [['babelify', {presets:["es2015"], extensions:[".ts",".js"]    }]]
      },
  </code></pre>
  
  <p>Notice the double brackets within the transform section -- forgetting those tripped me up when I initially started down this path.</p>