title: Angular2 testing: 'Unhandled Promise rejection:', 'Failed to load strategyTables.html'
body: <p>I caught this error when testing a component with templateUrl.I wonder if it's wrong with webpasck'test.I'm not shure how to fix it.thanks advance!</p>
  
  <p>ERROR: 'Unhandled Promise rejection:', 'Failed to load strategyTables.html', '; Zone:', 'ProxyZone', '; Task:', 'Promise.then', '; Value:', 'Failed to load strategyTables.html', undefined
  ERROR: Error{originalStack: 'Error: Uncaught (in promise): Failed to load strategyTables.html</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//karma.config.js
  // Karma configuration
  
  var webpackConfig = require('./webpack.test');
  module.exports = function(config) {
    config.set({
      // base path that will be used to resolve all patterns (eg. files, exclude)
      basePath: '.',
      // frameworks to use
      // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
      frameworks: ['jasmine'],
      // list of files / patterns to load in the browser
      files: [
        {pattern: './karma-shim.js', watched: false}
        ],
  
      // list of files to exclude
      exclude: [
      ],
      // preprocess matching files before serving them to the browser
      // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
      preprocessors: {
        './karma-shim.js': ['webpack']
      },
      webpack: webpackConfig,
      plugins:[
        'karma-jasmine',
        'karma-chrome-launcher',
        require("karma-webpack")
      ],
      proxies:{
        //http://localhost:3000/#/pages/strategys/strategytables
        "/app/": "base/src/app"
      },
      // test results reporter to use
      // possible values: 'dots', 'progress'
      // available reporters: https://npmjs.org/browse/keyword/karma-reporter
      reporters: ['progress'],
      // web server port
      port: 9876,
  
      // enable / disable colors in the output (reporters and logs)
      colors: true,
      // 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,
  
      // start these browsers
      // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
      browsers: ['Chrome'],
  
      // Continuous Integration mode
      // if true, Karma captures browsers, runs the tests and exits
      singleRun: false,
  
      // Concurrency level
     // how many browser should be started simultaneous
      concurrency: Infinity
    })
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//karma-shim,js
  Error.stackTraceLimit = Infinity;
  
  require('reflect-metadata');
  require('zone.js/dist/zone');
  require('zone.js/dist/proxy');
  require('zone.js/dist/sync-test');
  require('zone.js/dist/jasmine-patch');
  require('zone.js/dist/async-test');
  require('zone.js/dist/fake-async-test');
  
  
  var appContext = require.context('./src',true,/\.spec\.ts/);
  appContext.keys().forEach(appContext);
  
  
  var testing = require('@angular/core/testing');
  var testingBrowser = require('@angular/platform-browser-dynamic/testing');
  testing.TestBed.initTestEnvironment(testingBrowser.
      BrowserDynamicTestingModule,
      testingBrowser.platformBrowserDynamicTesting());</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//webpack.test.js
  module.exports = {
    devtool: 'cheap-module-eval-source-map',
    resolve: {
      extensions: ['.ts','.js']
    },
  
    entry: {
     },
  
    module: {
      loaders: [
        //��.ts��β���ļ�ʹ�� TypeScript loader
        {test: /.ts$/,loader: 'awesome-typescript-loader'},
        {
          test:/\.html$/,
          loader: 'html'
        },
        {
          test:/\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
          loader: 'null'
        },
        {
          test:/\.css$/,
          loader: 'null'
        }
      ]
    }
    
  }</code></pre>
  </div>
  </div>
  </p>