|
|
@@ -1,54 +1,51 @@
|
|
|
require.config({
|
|
|
- baseUrl: 'http://localhost:9876/base/public_gen/app',
|
|
|
+ baseUrl: 'http://localhost:9876/base/',
|
|
|
|
|
|
paths: {
|
|
|
- specs: '../test/specs',
|
|
|
- mocks: '../test/mocks',
|
|
|
- helpers: '../test/specs/helpers',
|
|
|
- config: 'components/config',
|
|
|
- kbn: 'components/kbn',
|
|
|
- store: 'components/store',
|
|
|
-
|
|
|
- settings: 'components/settings',
|
|
|
- lodash: 'components/lodash.extended',
|
|
|
- 'lodash-src': '../vendor/lodash',
|
|
|
-
|
|
|
- moment: '../vendor/moment',
|
|
|
- chromath: '../vendor/chromath',
|
|
|
- filesaver: '../vendor/filesaver',
|
|
|
-
|
|
|
- angular: '../vendor/angular/angular',
|
|
|
- 'angular-route': '../vendor/angular-route/angular-route',
|
|
|
- 'angular-sanitize': '../vendor/angular-sanitize/angular-sanitize',
|
|
|
- angularMocks: '../vendor/angular-mocks/angular-mocks',
|
|
|
- 'angular-dragdrop': '../vendor/angular-native-dragdrop/draganddrop',
|
|
|
- 'angular-ui': '../vendor/angular-ui/angular-bootstrap',
|
|
|
- 'angular-strap': '../vendor/angular-other/angular-strap',
|
|
|
- timepicker: '../vendor/angular-other/timepicker',
|
|
|
- datepicker: '../vendor/angular-other/datepicker',
|
|
|
- bindonce: '../vendor/angular-bindonce/bindonce',
|
|
|
- crypto: '../vendor/crypto.min',
|
|
|
- spectrum: '../vendor/spectrum',
|
|
|
-
|
|
|
- jquery: '../vendor/jquery/dist/jquery',
|
|
|
-
|
|
|
- bootstrap: '../vendor/bootstrap/bootstrap',
|
|
|
- 'bootstrap-tagsinput': '../vendor/tagsinput/bootstrap-tagsinput',
|
|
|
-
|
|
|
- 'extend-jquery': 'components/extend-jquery',
|
|
|
-
|
|
|
- 'jquery.flot': '../vendor/flot/jquery.flot',
|
|
|
- 'jquery.flot.pie': '../vendor/flot/jquery.flot.pie',
|
|
|
- 'jquery.flot.events': '../vendor/flot/jquery.flot.events',
|
|
|
- 'jquery.flot.selection': '../vendor/flot/jquery.flot.selection',
|
|
|
- 'jquery.flot.stack': '../vendor/flot/jquery.flot.stack',
|
|
|
- 'jquery.flot.stackpercent':'../vendor/flot/jquery.flot.stackpercent',
|
|
|
- 'jquery.flot.time': '../vendor/flot/jquery.flot.time',
|
|
|
- 'jquery.flot.crosshair': '../vendor/flot/jquery.flot.crosshair',
|
|
|
- 'jquery.flot.fillbelow': '../vendor/flot/jquery.flot.fillbelow',
|
|
|
-
|
|
|
- modernizr: '../vendor/modernizr-2.6.1',
|
|
|
- 'aws-sdk': '../vendor/aws-sdk/dist/aws-sdk.min',
|
|
|
+ config: 'app/components/config',
|
|
|
+ kbn: 'app/components/kbn',
|
|
|
+ store: 'app/components/store',
|
|
|
+
|
|
|
+ settings: 'app/components/settings',
|
|
|
+ lodash: 'app/components/lodash.extended',
|
|
|
+ 'lodash-src': 'vendor/lodash',
|
|
|
+
|
|
|
+ moment: 'vendor/moment',
|
|
|
+ chromath: 'vendor/chromath',
|
|
|
+ filesaver: 'vendor/filesaver',
|
|
|
+
|
|
|
+ angular: 'vendor/angular/angular',
|
|
|
+ 'angular-route': 'vendor/angular-route/angular-route',
|
|
|
+ 'angular-sanitize': 'vendor/angular-sanitize/angular-sanitize',
|
|
|
+ angularMocks: 'vendor/angular-mocks/angular-mocks',
|
|
|
+ 'angular-dragdrop': 'vendor/angular-native-dragdrop/draganddrop',
|
|
|
+ 'angular-ui': 'vendor/angular-ui/tabs',
|
|
|
+ 'angular-strap': 'vendor/angular-other/angular-strap',
|
|
|
+ timepicker: 'vendor/angular-other/timepicker',
|
|
|
+ datepicker: 'vendor/angular-other/datepicker',
|
|
|
+ bindonce: 'vendor/angular-bindonce/bindonce',
|
|
|
+ crypto: 'vendor/crypto.min',
|
|
|
+ spectrum: 'vendor/spectrum',
|
|
|
+
|
|
|
+ jquery: 'vendor/jquery/dist/jquery',
|
|
|
+
|
|
|
+ bootstrap: 'vendor/bootstrap/bootstrap',
|
|
|
+ 'bootstrap-tagsinput': 'vendor/tagsinput/bootstrap-tagsinput',
|
|
|
+
|
|
|
+ 'extend-jquery': 'app/components/extend-jquery',
|
|
|
+
|
|
|
+ 'jquery.flot': 'vendor/flot/jquery.flot',
|
|
|
+ 'jquery.flot.pie': 'vendor/flot/jquery.flot.pie',
|
|
|
+ 'jquery.flot.events': 'vendor/flot/jquery.flot.events',
|
|
|
+ 'jquery.flot.selection': 'vendor/flot/jquery.flot.selection',
|
|
|
+ 'jquery.flot.stack': 'vendor/flot/jquery.flot.stack',
|
|
|
+ 'jquery.flot.stackpercent':'vendor/flot/jquery.flot.stackpercent',
|
|
|
+ 'jquery.flot.time': 'vendor/flot/jquery.flot.time',
|
|
|
+ 'jquery.flot.crosshair': 'vendor/flot/jquery.flot.crosshair',
|
|
|
+ 'jquery.flot.fillbelow': 'vendor/flot/jquery.flot.fillbelow',
|
|
|
+
|
|
|
+ modernizr: 'vendor/modernizr-2.6.1',
|
|
|
+ 'aws-sdk': 'vendor/aws-sdk/dist/aws-sdk.min',
|
|
|
},
|
|
|
|
|
|
shim: {
|
|
|
@@ -98,20 +95,37 @@ require.config({
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+function file2moduleName(filePath) {
|
|
|
+ 'use strict';
|
|
|
+ return filePath.replace(/\\/g, '/')
|
|
|
+ .replace(/^\/base\//, '')
|
|
|
+ .replace(/\.\w*$/, '');
|
|
|
+}
|
|
|
+
|
|
|
require([
|
|
|
'angular',
|
|
|
- 'config',
|
|
|
'angularMocks',
|
|
|
- 'app',
|
|
|
-], function(angular, config) {
|
|
|
+ 'app/app',
|
|
|
+], function(angular) {
|
|
|
'use strict';
|
|
|
|
|
|
+ var specs = [];
|
|
|
+
|
|
|
for (var file in window.__karma__.files) {
|
|
|
- if (/spec\.js$/.test(file)) {
|
|
|
- window.tests.push(file.replace(/^\/base\//, 'http://localhost:9876/base/'));
|
|
|
+ if (/base\/test\/specs.*/.test(file)) {
|
|
|
+ console.log(file);
|
|
|
+ file = file2moduleName(file);
|
|
|
+ console.log(file);
|
|
|
+ specs.push(file);
|
|
|
+ //file = file.replace(/^\/base\/test/, '');
|
|
|
+ //specs.push(file);
|
|
|
+ //window.tests.push();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ require(specs, function() {
|
|
|
+ window.__karma__.start();
|
|
|
+ });
|
|
|
|
|
|
angular.module('grafana', ['ngRoute']);
|
|
|
angular.module('grafana.services', ['ngRoute', '$strap.directives']);
|
|
|
@@ -119,51 +133,49 @@ require([
|
|
|
angular.module('grafana.filters', []);
|
|
|
angular.module('grafana.routes', ['ngRoute']);
|
|
|
|
|
|
- var specs = [
|
|
|
- 'specs/lexer-specs',
|
|
|
- 'specs/parser-specs',
|
|
|
- 'specs/gfunc-specs',
|
|
|
- 'specs/timeSeries-specs',
|
|
|
- 'specs/row-ctrl-specs',
|
|
|
- 'specs/graphiteTargetCtrl-specs',
|
|
|
- 'specs/graphiteDatasource-specs',
|
|
|
- 'specs/influxSeries-specs',
|
|
|
- 'specs/influxSeries08-specs',
|
|
|
- 'specs/influxQueryBuilder-specs',
|
|
|
- 'specs/influx09-querybuilder-specs',
|
|
|
- 'specs/influxdb-datasource-specs',
|
|
|
- 'specs/influxdbQueryCtrl-specs',
|
|
|
- 'specs/kairosdb-datasource-specs',
|
|
|
- 'specs/graph-ctrl-specs',
|
|
|
- 'specs/graph-specs',
|
|
|
- 'specs/graph-tooltip-specs',
|
|
|
- 'specs/seriesOverridesCtrl-specs',
|
|
|
- 'specs/shareModalCtrl-specs',
|
|
|
- 'specs/timeSrv-specs',
|
|
|
- 'specs/panelSrv-specs',
|
|
|
- 'specs/templateSrv-specs',
|
|
|
- 'specs/templateValuesSrv-specs',
|
|
|
- 'specs/kbn-format-specs',
|
|
|
- 'specs/dashboardSrv-specs',
|
|
|
- 'specs/dashboardViewStateSrv-specs',
|
|
|
- 'specs/singlestat-specs',
|
|
|
- 'specs/dynamicDashboardSrv-specs',
|
|
|
- 'specs/unsavedChangesSrv-specs',
|
|
|
- 'specs/value_select_dropdown_specs',
|
|
|
- 'specs/opentsdbDatasource-specs',
|
|
|
- 'specs/cloudwatch-datasource-specs',
|
|
|
- 'specs/elasticsearch-specs',
|
|
|
- 'specs/elasticsearch-querybuilder-specs',
|
|
|
- 'specs/elasticsearch-queryctrl-specs',
|
|
|
- 'specs/elasticsearch-indexPattern-specs',
|
|
|
- 'specs/elasticsearch-response-specs',
|
|
|
- ];
|
|
|
-
|
|
|
- var pluginSpecs = (config.plugins.specs || []).map(function (spec) {
|
|
|
- return '../plugins/' + spec;
|
|
|
- });
|
|
|
+ // var specs = [
|
|
|
+ // 'specs/lexer-specs',
|
|
|
+ // 'specs/parser-specs',
|
|
|
+ // 'specs/gfunc-specs',
|
|
|
+ // 'specs/timeSeries-specs',
|
|
|
+ // 'specs/row-ctrl-specs',
|
|
|
+ // 'specs/graphiteTargetCtrl-specs',
|
|
|
+ // 'specs/graphiteDatasource-specs',
|
|
|
+ // 'specs/influxSeries-specs',
|
|
|
+ // 'specs/influxSeries08-specs',
|
|
|
+ // 'specs/influxQueryBuilder-specs',
|
|
|
+ // 'specs/influx09-querybuilder-specs',
|
|
|
+ // // 'specs/influxdb-datasource-specs',
|
|
|
+ // 'specs/influxdbQueryCtrl-specs',
|
|
|
+ // // 'specs/kairosdb-datasource-specs',
|
|
|
+ // 'specs/graph-ctrl-specs',
|
|
|
+ // 'specs/graph-specs',
|
|
|
+ // 'specs/graph-tooltip-specs',
|
|
|
+ // 'specs/seriesOverridesCtrl-specs',
|
|
|
+ // 'specs/shareModalCtrl-specs',
|
|
|
+ // 'specs/timeSrv-specs',
|
|
|
+ // 'specs/panelSrv-specs',
|
|
|
+ // 'specs/templateSrv-specs',
|
|
|
+ // 'specs/templateValuesSrv-specs',
|
|
|
+ // 'specs/kbn-format-specs',
|
|
|
+ // 'specs/dashboardSrv-specs',
|
|
|
+ // 'specs/dashboardViewStateSrv-specs',
|
|
|
+ // 'specs/singlestat-specs',
|
|
|
+ // 'specs/dynamicDashboardSrv-specs',
|
|
|
+ // 'specs/unsavedChangesSrv-specs',
|
|
|
+ // 'specs/value_select_dropdown_specs',
|
|
|
+ // 'specs/opentsdbDatasource-specs',
|
|
|
+ // 'specs/cloudwatch-datasource-specs',
|
|
|
+ // 'specs/elasticsearch-specs',
|
|
|
+ // 'specs/elasticsearch-querybuilder-specs',
|
|
|
+ // 'specs/elasticsearch-queryctrl-specs',
|
|
|
+ // 'specs/elasticsearch-indexPattern-specs',
|
|
|
+ // 'specs/elasticsearch-response-specs',
|
|
|
+ // 'specs/core/utils/datemath_specs',
|
|
|
+ // ];
|
|
|
+ //
|
|
|
+ // var pluginSpecs = (config.plugins.specs || []).map(function (spec) {
|
|
|
+ // return '../plugins/' + spec;
|
|
|
+ // });
|
|
|
|
|
|
- require(specs.concat(pluginSpecs), function () {
|
|
|
- window.__karma__.start();
|
|
|
- });
|
|
|
});
|