// Karma configuration
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
var file2moduleName = require('./file2modulename');

module.exports = function(config) {
  config.set({

    frameworks: ['dart-unittest'],

    files: [
      {pattern: 'modules/**/*_spec.js', included: true},
      {pattern: 'modules/*/src/**/*', included: false},
      {pattern: 'modules/*/test/**/*', included: false},
      {pattern: 'tools/transpiler/spec/**/*_spec.js', included: true},
      {pattern: 'tools/transpiler/spec/**/*', included: false},
      'test-main.dart'
    ],

    karmaDartImports: {
      guinness: 'package:guinness/guinness_html.dart'
    },

    preprocessors: {
      'modules/**/*.js': ['traceur'],
      'tools/**/*.js': ['traceur']
    },
    traceurPreprocessor: {
      options: {
        outputLanguage: 'dart',
        script: false,
        modules: 'register',
        types: true,
        // typeAssertions: true,
        // typeAssertionModule: 'assert',
        annotations: true
      },
      resolveModuleName: file2moduleName,
      transformPath: function(fileName) {
        return fileName.replace('.js', '.dart');
      }
    },

    customLaunchers: {
      DartiumWithWebPlatform: {
        base: 'Dartium',
        flags: ['--enable-experimental-web-platform-features'] }
    },
    browsers: ['DartiumWithWebPlatform'],
  });


  config.plugins.push(require('./tools/transpiler/karma-traceur-preprocessor'));
};

@@ -226,16 +226,145 @@
 iles: %5B%0A
+      // Unit test files needs to be included.%0A      // Karma-dart generates %60__adapter_unittest.dart%60 that imports these files.%0A
       %7Bp
@@ -381,16 +381,23 @@
 odules/*
+/test/*
 */*_spec
@@ -440,46 +440,144 @@
 n: '
-modules/*/src/**/*', included: false%7D,
+tools/transpiler/spec/**/*_spec.js', included: true%7D,%0A%0A      // These files are not included, they are imported by the unit tests above.
 %0A   
@@ -599,25 +599,16 @@
 odules/*
-/test/**/
 *', incl
@@ -660,32 +660,24 @@
 er/spec/**/*
-_spec.js
 ', included:
@@ -681,58 +681,105 @@
 ed: 
-tru
+fals
 e%7D,%0A
+%0A
       
-%7Bpattern: 'tools/transpiler/spec/**/*
+// Dependencies, installed with %60pub install%60.%0A      %7Bpattern: 'packages/**/*.dart
 ', i
@@ -778,32 +778,48 @@
 dart', included:
+ false, watched:
  false%7D,%0A      '
@@ -815,30 +815,95 @@
 e%7D,%0A
+%0A 
      
- 'test-main.dart'
+// Init and configure guiness.%0A      %7Bpattern: 'test-main.dart', included: true%7D
 %0A   
@@ -989,24 +989,834 @@
 rt'%0A    %7D,%0A%0A
+    // Map packages to the correct urls where Karma serves them.%0A    proxies: %7B%0A      // Dependencies installed with %60pub install%60.%0A      '/packages/unittest': '/base/packages/unittest',%0A      '/packages/guinness': '/base/packages/guinness',%0A      '/packages/matcher': '/base/packages/matcher',%0A      '/packages/stack_trace': '/base/packages/stack_trace',%0A      '/packages/collection': '/base/packages/collection',%0A      '/packages/path': '/base/packages/path',%0A%0A      // Local dependencies, transpiled from the source.%0A      '/packages/core': '/base/modules/core/src',%0A      '/packages/change_detection': '/base/modules/change_detection/src',%0A      '/packages/di': '/base/modules/di/src',%0A      '/packages/facade': '/base/modules/facade/src',%0A      '/packages/test_lib': '/base/modules/test_lib/src',%0A    %7D,%0A%0A
     preproce
@@ -1900,24 +1900,25 @@
 ur'%5D%0A    %7D,%0A
+%0A
     traceurP

fix karma dart setup