grafana/public/test/test-main.js

154 lines
4.9 KiB
JavaScript
Raw Normal View History

require.config({
baseUrl: 'http://localhost:9876/base/public/app',
paths: {
specs: '../test/specs',
2014-03-22 07:45:02 -05:00
mocks: '../test/mocks',
helpers: '../test/specs/helpers',
config: 'components/config',
kbn: 'components/kbn',
2014-08-16 06:13:26 -05:00
store: 'components/store',
settings: 'components/settings',
2014-08-07 07:35:19 -05:00
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/angular-route',
'angular-sanitize': '../vendor/angular/angular-sanitize',
angularMocks: '../vendor/angular/angular-mocks',
'angular-dragdrop': '../vendor/angular/angular-dragdrop',
'angular-strap': '../vendor/angular/angular-strap',
timepicker: '../vendor/angular/timepicker',
datepicker: '../vendor/angular/datepicker',
bindonce: '../vendor/angular/bindonce',
crypto: '../vendor/crypto.min',
spectrum: '../vendor/spectrum',
jquery: '../vendor/jquery/jquery-2.1.1.min',
2014-05-03 10:00:48 -05:00
bootstrap: '../vendor/bootstrap/bootstrap',
'bootstrap-tagsinput': '../vendor/tagsinput/bootstrap-tagsinput',
'extend-jquery': 'components/extend-jquery',
'jquery.flot': '../vendor/jquery/jquery.flot',
'jquery.flot.pie': '../vendor/jquery/jquery.flot.pie',
'jquery.flot.events': '../vendor/jquery/jquery.flot.events',
'jquery.flot.selection': '../vendor/jquery/jquery.flot.selection',
'jquery.flot.stack': '../vendor/jquery/jquery.flot.stack',
'jquery.flot.stackpercent':'../vendor/jquery/jquery.flot.stackpercent',
'jquery.flot.time': '../vendor/jquery/jquery.flot.time',
2014-09-23 06:51:59 -05:00
'jquery.flot.crosshair': '../vendor/jquery/jquery.flot.crosshair',
'jquery.flot.fillbelow': '../vendor/jquery/jquery.flot.fillbelow',
modernizr: '../vendor/modernizr-2.6.1',
},
shim: {
bootstrap: {
deps: ['jquery']
},
modernizr: {
exports: 'Modernizr'
},
angular: {
deps: ['jquery', 'config'],
exports: 'angular'
},
angularMocks: {
deps: ['angular'],
},
crypto: {
exports: 'Crypto'
},
'jquery.flot': ['jquery'],
'jquery.flot.pie': ['jquery', 'jquery.flot'],
'jquery.flot.events': ['jquery', 'jquery.flot'],
'jquery.flot.selection':['jquery', 'jquery.flot'],
'jquery.flot.stack': ['jquery', 'jquery.flot'],
'jquery.flot.stackpercent':['jquery', 'jquery.flot'],
'jquery.flot.time': ['jquery', 'jquery.flot'],
2014-09-23 06:51:59 -05:00
'jquery.flot.crosshair':['jquery', 'jquery.flot'],
'jquery.flot.fillbelow':['jquery', 'jquery.flot'],
'angular-route': ['angular'],
'angular-sanitize': ['angular'],
'angular-dragdrop': ['jquery', 'angular'],
'angular-mocks': ['angular'],
'angular-strap': ['angular', 'bootstrap','timepicker', 'datepicker'],
'bindonce': ['angular'],
2014-05-03 10:00:48 -05:00
'bootstrap-tagsinput': ['jquery'],
timepicker: ['jquery', 'bootstrap'],
datepicker: ['jquery', 'bootstrap'],
}
});
require([
2014-03-22 07:45:02 -05:00
'angular',
'config',
2014-03-22 07:45:02 -05:00
'angularMocks',
'app',
], function(angular, config) {
'use strict';
2014-03-22 07:45:02 -05:00
2014-08-06 09:11:17 -05:00
for (var file in window.__karma__.files) {
if (/spec\.js$/.test(file)) {
window.tests.push(file.replace(/^\/base\//, 'http://localhost:9876/base/'));
}
}
angular.module('grafana', ['ngRoute']);
angular.module('grafana.services', ['ngRoute', '$strap.directives']);
2014-07-28 11:11:52 -05:00
angular.module('grafana.panels', []);
angular.module('grafana.filters', []);
angular.module('grafana.routes', ['ngRoute']);
2014-03-22 07:45:02 -05:00
var specs = [
2014-03-22 07:45:02 -05:00
'specs/lexer-specs',
'specs/parser-specs',
'specs/gfunc-specs',
'specs/timeSeries-specs',
2014-08-11 08:59:03 -05:00
'specs/row-ctrl-specs',
2014-08-07 03:42:05 -05:00
'specs/graphiteTargetCtrl-specs',
'specs/graphiteDatasource-specs',
'specs/influxSeries-specs',
'specs/influxQueryBuilder-specs',
'specs/influx09-querybuilder-specs',
2014-08-08 10:33:00 -05:00
'specs/influxdb-datasource-specs',
'specs/graph-ctrl-specs',
'specs/graph-specs',
'specs/graph-tooltip-specs',
'specs/seriesOverridesCtrl-specs',
2015-03-29 07:30:03 -05:00
'specs/shareModalCtrl-specs',
'specs/timeSrv-specs',
'specs/templateSrv-specs',
'specs/templateValuesSrv-specs',
2014-05-03 10:00:48 -05:00
'specs/kbn-format-specs',
'specs/dashboardSrv-specs',
'specs/dashboardViewStateSrv-specs',
2015-01-08 02:34:46 -06:00
'specs/soloPanelCtrl-specs',
];
var pluginSpecs = (config.plugins.specs || []).map(function (spec) {
return '../plugins/' + spec;
2014-03-22 07:45:02 -05:00
});
require(specs.concat(pluginSpecs), function () {
window.__karma__.start();
});
2014-03-22 07:45:02 -05:00
});