title: Karma testing with Angular2: Unexpected anonymous System.register call
body: <p>When I run Karma Tests in Angular2 i get the following error.</p>
  
  <p>Uncaught TypeError: Unexpected anonymous System.register call.
  at <a href="http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:2885" rel="nofollow">http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?38538ebca96bc7b222f7e7ba15943f173a485f6e:2885</a></p>
  
  <p>I suppose its because the var System is currently not available. Even if its actually loaded.
  Does anyone have an idea why this is not working?</p>
  
  <h2>Here is my stripped down configuration:</h2>
  
  <p>C:\project\karma.conf.js</p>
  
  <pre><code>module.exports = function(config) {
    config.set({
      basePath: '',
      frameworks: ['jasmine'],
      files: [
        'node_modules/systemjs/dist/system.src.js',
        'node_modules/angular2/bundles/angular2.dev.js',
        'tests/**/*Spec.js'
      ],
      exclude: [
      ],
      preprocessors: {
      },
      reporters: ['progress'],
      port: 9876,
      colors: true,
      logLevel: config.LOG_INFO,
      autoWatch: false,
      browsers: ['Chrome', 'Firefox'],
      singleRun: false,
      concurrency: Infinity
    })
  }
  </code></pre>
  
  <hr>
  
  <p>C:\project\tests\MyTestSpec.ts
  This one line is enough to trigger the error.</p>
  
  <pre><code>import {describe, expect, it, xit, inject, beforeEachProviders} from 'angular2/testing';
  </code></pre>
  
  <hr>
  
  <p>that renders to 
  C:\project\tests\MyTestSpec.js
  and produces an error on the first occurance of System</p>
  
  <pre><code>System.register([], function(exports_1) {
      return {
          setters:[],
          execute: function() {
          }
      }
  });
  //# sourceMappingURL=CmiCloudSpec.js.map
  </code></pre>
  
  <hr>
  
  <p>C:\project\tsconfig.json</p>
  
  <pre><code>{
    "compilerOptions": {
      "target": "es5",
      "module": "system",
      "moduleResolution": "node",
      "sourceMap": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "removeComments": false,
      "noImplicitAny": false,
      "watch": true,
    },
    "exclude": [
      "node_modules",
      "typings/main",
      "typings/main.d.ts"
    ]
  }
  </code></pre>
  
  <hr>
  
  <p>C:\project\src\node_modules</p>
  
  <p>contains the folders angular2 and systemjs as well as karma, karma-jasmine, jasmine-core and typescript</p>