2014-09-25 17:04:46 -04:00
|
|
|
// Karma configuration
|
|
|
|
// Generated on Thu Sep 25 2014 11:52:02 GMT-0700 (PDT)
|
2014-12-05 19:26:30 -05:00
|
|
|
var file2moduleName = require('./tools/build/file2modulename');
|
2014-09-25 17:04:46 -04:00
|
|
|
|
|
|
|
module.exports = function(config) {
|
|
|
|
config.set({
|
|
|
|
|
|
|
|
frameworks: ['dart-unittest'],
|
|
|
|
|
|
|
|
files: [
|
2015-04-07 23:54:20 -04:00
|
|
|
// Init and configure guiness.
|
|
|
|
{pattern: 'test-init.dart', included: true},
|
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},
|
2015-04-10 02:17:05 -04:00
|
|
|
{pattern: 'modules/*/test/**/*_spec.dart', 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-10-09 16:50:25 -04:00
|
|
|
// TODO(vojta): Remove the localhost:9877 from urls, once the proxy fix is merged:
|
|
|
|
// https://github.com/karma-runner/karma/pull/1207
|
|
|
|
//
|
2014-09-30 19:55:59 -04:00
|
|
|
// Map packages to the correct urls where Karma serves them.
|
|
|
|
proxies: {
|
|
|
|
// Dependencies installed with `pub install`.
|
2014-10-09 16:50:25 -04:00
|
|
|
'/packages/unittest': 'http://localhost:9877/base/packages/unittest',
|
|
|
|
'/packages/guinness': 'http://localhost:9877/base/packages/guinness',
|
|
|
|
'/packages/matcher': 'http://localhost:9877/base/packages/matcher',
|
|
|
|
'/packages/stack_trace': 'http://localhost:9877/base/packages/stack_trace',
|
|
|
|
'/packages/collection': 'http://localhost:9877/base/packages/collection',
|
|
|
|
'/packages/path': 'http://localhost:9877/base/packages/path',
|
2014-09-30 19:55:59 -04:00
|
|
|
|
|
|
|
// Local dependencies, transpiled from the source.
|
2015-02-02 19:25:34 -05:00
|
|
|
'/packages/angular': 'http://localhost:9877/base/modules/angular',
|
2015-02-11 13:13:49 -05:00
|
|
|
'/packages/benchpress': 'http://localhost:9877/base/modules/benchpress',
|
2015-02-02 19:25:34 -05:00
|
|
|
'/packages/core': 'http://localhost:9877/base/modules/core',
|
|
|
|
'/packages/change_detection': 'http://localhost:9877/base/modules/change_detection',
|
|
|
|
'/packages/reflection': 'http://localhost:9877/base/modules/reflection',
|
2015-04-17 12:59:56 -04:00
|
|
|
'/packages/router': 'http://localhost:9877/base/modules/router',
|
2015-02-02 19:25:34 -05:00
|
|
|
'/packages/di': 'http://localhost:9877/base/modules/di',
|
|
|
|
'/packages/directives': 'http://localhost:9877/base/modules/directives',
|
|
|
|
'/packages/facade': 'http://localhost:9877/base/modules/facade',
|
2015-02-03 10:27:09 -05:00
|
|
|
'/packages/forms': 'http://localhost:9877/base/modules/forms',
|
2015-01-30 03:43:21 -05:00
|
|
|
'/packages/test_lib': 'http://localhost:9877/base/modules/test_lib',
|
|
|
|
'/packages/mock': 'http://localhost:9877/base/modules/mock',
|
2014-09-30 19:55:59 -04:00
|
|
|
},
|
|
|
|
|
2014-09-25 17:04:46 -04:00
|
|
|
preprocessors: {
|
2015-04-03 14:54:33 -04:00
|
|
|
'modules/**/*.js': ['ts2dart'],
|
2015-04-27 19:11:20 -04:00
|
|
|
'modules/angular2/src/reflection/reflector.ts': ['ts2dart'],
|
2015-04-03 14:54:33 -04:00
|
|
|
'tools/**/*.js': ['ts2dart']
|
2014-09-25 17:04:46 -04:00
|
|
|
},
|
2014-09-30 19:55:59 -04:00
|
|
|
|
2015-04-03 14:54:33 -04:00
|
|
|
ts2dartPreprocessor: {
|
2014-09-28 16:55:01 -04:00
|
|
|
resolveModuleName: file2moduleName,
|
2014-09-25 17:04:46 -04:00
|
|
|
transformPath: function(fileName) {
|
2015-04-27 19:11:20 -04:00
|
|
|
return fileName.replace(/\.(js|ts)$/, '.dart');
|
2014-09-25 17:04:46 -04:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2014-09-29 17:20:23 -04:00
|
|
|
customLaunchers: {
|
|
|
|
DartiumWithWebPlatform: {
|
|
|
|
base: 'Dartium',
|
|
|
|
flags: ['--enable-experimental-web-platform-features'] }
|
|
|
|
},
|
|
|
|
browsers: ['DartiumWithWebPlatform'],
|
2014-10-09 16:50:25 -04:00
|
|
|
|
|
|
|
port: 9877
|
2014-09-25 17:04:46 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2015-04-03 14:54:33 -04:00
|
|
|
config.plugins.push(require('./tools/transpiler/karma-ts2dart-preprocessor'));
|
2014-09-25 17:04:46 -04:00
|
|
|
};
|