2014-09-25 17:04:46 -04:00
|
|
|
// Karma configuration
|
|
|
|
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
|
2014-09-28 16:55:01 -04:00
|
|
|
var file2moduleName = require('./file2modulename');
|
2014-09-25 17:04:46 -04:00
|
|
|
|
|
|
|
module.exports = function(config) {
|
|
|
|
config.set({
|
|
|
|
|
|
|
|
frameworks: ['dart-unittest'],
|
|
|
|
|
|
|
|
files: [
|
2014-09-30 19:55:59 -04:00
|
|
|
// Unit test files needs to be included.
|
|
|
|
// Karma-dart generates `__adapter_unittest.dart` that imports these files.
|
|
|
|
{pattern: 'modules/*/test/**/*_spec.js', included: true},
|
2014-09-28 16:55:01 -04:00
|
|
|
{pattern: 'tools/transpiler/spec/**/*_spec.js', included: true},
|
2014-09-30 19:55:59 -04:00
|
|
|
|
|
|
|
// These files are not included, they are imported by the unit tests above.
|
|
|
|
{pattern: 'modules/**', included: false},
|
2014-09-28 16:55:01 -04:00
|
|
|
{pattern: 'tools/transpiler/spec/**/*', included: false},
|
2014-09-30 19:55:59 -04:00
|
|
|
|
|
|
|
// Dependencies, installed with `pub install`.
|
|
|
|
{pattern: 'packages/**/*.dart', included: false, watched: false},
|
|
|
|
|
|
|
|
// Init and configure guiness.
|
|
|
|
{pattern: 'test-main.dart', included: true}
|
2014-09-25 17:04:46 -04:00
|
|
|
],
|
|
|
|
|
|
|
|
karmaDartImports: {
|
|
|
|
guinness: 'package:guinness/guinness_html.dart'
|
|
|
|
},
|
|
|
|
|
2014-09-30 19:55:59 -04:00
|
|
|
// Map packages to the correct urls where Karma serves them.
|
|
|
|
proxies: {
|
|
|
|
// Dependencies installed with `pub install`.
|
|
|
|
'/packages/unittest': '/base/packages/unittest',
|
|
|
|
'/packages/guinness': '/base/packages/guinness',
|
|
|
|
'/packages/matcher': '/base/packages/matcher',
|
|
|
|
'/packages/stack_trace': '/base/packages/stack_trace',
|
|
|
|
'/packages/collection': '/base/packages/collection',
|
|
|
|
'/packages/path': '/base/packages/path',
|
|
|
|
|
|
|
|
// Local dependencies, transpiled from the source.
|
|
|
|
'/packages/core': '/base/modules/core/src',
|
|
|
|
'/packages/change_detection': '/base/modules/change_detection/src',
|
|
|
|
'/packages/di': '/base/modules/di/src',
|
|
|
|
'/packages/facade': '/base/modules/facade/src',
|
|
|
|
'/packages/test_lib': '/base/modules/test_lib/src',
|
|
|
|
},
|
|
|
|
|
2014-09-25 17:04:46 -04:00
|
|
|
preprocessors: {
|
2014-09-28 16:55:01 -04:00
|
|
|
'modules/**/*.js': ['traceur'],
|
|
|
|
'tools/**/*.js': ['traceur']
|
2014-09-25 17:04:46 -04:00
|
|
|
},
|
2014-09-30 19:55:59 -04:00
|
|
|
|
2014-09-25 17:04:46 -04:00
|
|
|
traceurPreprocessor: {
|
|
|
|
options: {
|
|
|
|
outputLanguage: 'dart',
|
|
|
|
script: false,
|
|
|
|
modules: 'register',
|
|
|
|
types: true,
|
|
|
|
// typeAssertions: true,
|
|
|
|
// typeAssertionModule: 'assert',
|
|
|
|
annotations: true
|
|
|
|
},
|
2014-09-28 16:55:01 -04:00
|
|
|
resolveModuleName: file2moduleName,
|
2014-09-25 17:04:46 -04:00
|
|
|
transformPath: function(fileName) {
|
|
|
|
return fileName.replace('.js', '.dart');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2014-09-29 17:20:23 -04:00
|
|
|
customLaunchers: {
|
|
|
|
DartiumWithWebPlatform: {
|
|
|
|
base: 'Dartium',
|
|
|
|
flags: ['--enable-experimental-web-platform-features'] }
|
|
|
|
},
|
|
|
|
browsers: ['DartiumWithWebPlatform'],
|
2014-09-25 17:04:46 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2014-09-26 20:39:27 -04:00
|
|
|
config.plugins.push(require('./tools/transpiler/karma-traceur-preprocessor'));
|
2014-09-25 17:04:46 -04:00
|
|
|
};
|