// @AngularClass
/*
 * When testing with webpack and ES6, we have to do some extra
 * things get testing to work right. Because we are gonna write test
 * in ES6 to, we have to compile those as well. That's handled in
 * karma.conf.js with the karma-webpack plugin. This is the entry
 * file for webpack test. Just like webpack will create a bundle.js
 * file for our client, when we run test, it well compile and bundle them
 * all here! Crazy huh. So we need to do some setup
*/
Error.stackTraceLimit = Infinity;
require('phantomjs-polyfill');
require('es6-promise');
require('es6-shim');
require('es7-reflect-metadata/dist/browser');
require('zone.js/lib/browser/zone-microtask.js');
require('zone.js/lib/browser/long-stack-trace-zone.js');
require('zone.js/lib/browser/jasmine-patch.js');
require('angular2/testing');

/*
  Ok, this is kinda crazy. We can use the the context method on
  require that webpack created in order to tell webpack
  what files we actually want to require or import.
  Below, context will be an function/object with file names as keys.
  using that regex we are saying look in client/app and find
  any file that ends with spec.js and get its path. By passing in true
  we say do this recursively
*/
var testContext = require.context('./test', true, /\.spec\.ts/);
var appContext = require.context('./src', true, /\.spec\.ts/);

// get all the files, for each file, call the context function
// that will require the file and load it up here. Context will
// loop and require those spec files here
appContext.keys().forEach(appContext);
testContext.keys().forEach(testContext);

// Select BrowserDomAdapter.
// see https://github.com/AngularClass/angular2-webpack-starter/issues/124
var domAdapter = require('angular2/src/platform/browser/browser_adapter');
domAdapter.BrowserDomAdapter.makeCurrent();

@@ -782,24 +782,103 @@
 patch.js');%0A
+// these are global EmitHelpers used by compiled typescript%0AglobalPolyfills()%0A%0A
 require('ang
@@ -1905,8 +1905,1508 @@
 rent();%0A
+%0A%0A%0A%0A// these are helpers that typescript uses%0A// I manually added them by opting out of EmitHelpers by noEmitHelpers: false%0Afunction globalPolyfills()%7B%0A  global.__extends = (this && this.__extends) %7C%7C function (d, b) %7B%0A    for (var p in b) if (b.hasOwnProperty(p)) d%5Bp%5D = b%5Bp%5D;%0A    var __ = function() %7B this.constructor = d; %7D;%0A    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());%0A  %7D;%0A%0A  global.__decorate = global.Reflect.decorate;%0A  global.__metadata = global.Reflect.metadata;%0A%0A  global.__param = (this && this.__param) %7C%7C function (paramIndex, decorator) %7B%0A    return function (target, key) %7B decorator(target, key, paramIndex); %7D;%0A  %7D;%0A%0A  global.__awaiter = (this && this.__awaiter) %7C%7C%0A    function (thisArg, _arguments, Promise, generator) %7B%0A      return new Promise(function (resolve, reject) %7B%0A        generator = generator.call(thisArg, _arguments);%0A        function cast(value) %7B%0A          return value instanceof Promise && value.constructor === Promise ?%0A          value : new Promise(function (resolve) %7B resolve(value); %7D); %7D%0A        function onfulfill(value) %7B try %7B step('next', value); %7D catch (e) %7B reject(e); %7D %7D%0A        function onreject(value) %7B try %7B step('throw', value); %7D catch (e) %7B reject(e); %7D %7D%0A        function step(verb, value) %7B%0A          var result = generator%5Bverb%5D(value);%0A          result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);%0A        %7D%0A        step('next', void 0);%0A      %7D);%0A    %7D;%0A%7D%0A

add ts global polyfills