test-main.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. require.config({
  2. baseUrl: 'http://localhost:9876/base/',
  3. paths: {
  4. config: 'app/components/config',
  5. kbn: 'app/components/kbn',
  6. store: 'app/components/store',
  7. settings: 'app/components/settings',
  8. lodash: 'app/components/lodash.extended',
  9. 'lodash-src': 'vendor/lodash',
  10. moment: 'vendor/moment',
  11. chromath: 'vendor/chromath',
  12. filesaver: 'vendor/filesaver',
  13. angular: 'vendor/angular/angular',
  14. 'angular-route': 'vendor/angular-route/angular-route',
  15. 'angular-sanitize': 'vendor/angular-sanitize/angular-sanitize',
  16. angularMocks: 'vendor/angular-mocks/angular-mocks',
  17. 'angular-dragdrop': 'vendor/angular-native-dragdrop/draganddrop',
  18. 'angular-ui': 'vendor/angular-ui/tabs',
  19. 'angular-strap': 'vendor/angular-other/angular-strap',
  20. timepicker: 'vendor/angular-other/timepicker',
  21. datepicker: 'vendor/angular-other/datepicker',
  22. bindonce: 'vendor/angular-bindonce/bindonce',
  23. crypto: 'vendor/crypto.min',
  24. spectrum: 'vendor/spectrum',
  25. jquery: 'vendor/jquery/dist/jquery',
  26. bootstrap: 'vendor/bootstrap/bootstrap',
  27. 'bootstrap-tagsinput': 'vendor/tagsinput/bootstrap-tagsinput',
  28. 'extend-jquery': 'app/components/extend-jquery',
  29. 'jquery.flot': 'vendor/flot/jquery.flot',
  30. 'jquery.flot.pie': 'vendor/flot/jquery.flot.pie',
  31. 'jquery.flot.events': 'vendor/flot/jquery.flot.events',
  32. 'jquery.flot.selection': 'vendor/flot/jquery.flot.selection',
  33. 'jquery.flot.stack': 'vendor/flot/jquery.flot.stack',
  34. 'jquery.flot.stackpercent':'vendor/flot/jquery.flot.stackpercent',
  35. 'jquery.flot.time': 'vendor/flot/jquery.flot.time',
  36. 'jquery.flot.crosshair': 'vendor/flot/jquery.flot.crosshair',
  37. 'jquery.flot.fillbelow': 'vendor/flot/jquery.flot.fillbelow',
  38. modernizr: 'vendor/modernizr-2.6.1',
  39. 'aws-sdk': 'vendor/aws-sdk/dist/aws-sdk.min',
  40. },
  41. shim: {
  42. bootstrap: {
  43. deps: ['jquery']
  44. },
  45. modernizr: {
  46. exports: 'Modernizr'
  47. },
  48. angular: {
  49. deps: ['jquery', 'config'],
  50. exports: 'angular'
  51. },
  52. angularMocks: {
  53. deps: ['angular'],
  54. },
  55. crypto: {
  56. exports: 'Crypto'
  57. },
  58. 'jquery.flot': ['jquery'],
  59. 'jquery.flot.pie': ['jquery', 'jquery.flot'],
  60. 'jquery.flot.events': ['jquery', 'jquery.flot'],
  61. 'jquery.flot.selection':['jquery', 'jquery.flot'],
  62. 'jquery.flot.stack': ['jquery', 'jquery.flot'],
  63. 'jquery.flot.stackpercent':['jquery', 'jquery.flot'],
  64. 'jquery.flot.time': ['jquery', 'jquery.flot'],
  65. 'jquery.flot.crosshair':['jquery', 'jquery.flot'],
  66. 'jquery.flot.fillbelow':['jquery', 'jquery.flot'],
  67. 'angular-route': ['angular'],
  68. 'angular-sanitize': ['angular'],
  69. 'angular-ui': ['angular'],
  70. 'angular-dragdrop': ['jquery', 'angular'],
  71. 'angular-mocks': ['angular'],
  72. 'angular-strap': ['angular', 'bootstrap','timepicker', 'datepicker'],
  73. 'bindonce': ['angular'],
  74. 'bootstrap-tagsinput': ['jquery'],
  75. timepicker: ['jquery', 'bootstrap'],
  76. datepicker: ['jquery', 'bootstrap'],
  77. }
  78. });
  79. function file2moduleName(filePath) {
  80. 'use strict';
  81. return filePath.replace(/\\/g, '/')
  82. .replace(/^\/base\//, '')
  83. .replace(/\.\w*$/, '');
  84. }
  85. require([
  86. 'angular',
  87. 'angularMocks',
  88. 'app/app',
  89. ], function(angular) {
  90. 'use strict';
  91. var specs = [];
  92. for (var file in window.__karma__.files) {
  93. if (/base\/test\/specs.*/.test(file)) {
  94. console.log(file);
  95. file = file2moduleName(file);
  96. console.log(file);
  97. specs.push(file);
  98. //file = file.replace(/^\/base\/test/, '');
  99. //specs.push(file);
  100. //window.tests.push();
  101. }
  102. }
  103. require(specs, function() {
  104. window.__karma__.start();
  105. });
  106. angular.module('grafana', ['ngRoute']);
  107. angular.module('grafana.services', ['ngRoute', '$strap.directives']);
  108. angular.module('grafana.panels', []);
  109. angular.module('grafana.filters', []);
  110. angular.module('grafana.routes', ['ngRoute']);
  111. // var specs = [
  112. // 'specs/lexer-specs',
  113. // 'specs/parser-specs',
  114. // 'specs/gfunc-specs',
  115. // 'specs/timeSeries-specs',
  116. // 'specs/row-ctrl-specs',
  117. // 'specs/graphiteTargetCtrl-specs',
  118. // 'specs/graphiteDatasource-specs',
  119. // 'specs/influxSeries-specs',
  120. // 'specs/influxSeries08-specs',
  121. // 'specs/influxQueryBuilder-specs',
  122. // 'specs/influx09-querybuilder-specs',
  123. // // 'specs/influxdb-datasource-specs',
  124. // 'specs/influxdbQueryCtrl-specs',
  125. // // 'specs/kairosdb-datasource-specs',
  126. // 'specs/graph-ctrl-specs',
  127. // 'specs/graph-specs',
  128. // 'specs/graph-tooltip-specs',
  129. // 'specs/seriesOverridesCtrl-specs',
  130. // 'specs/shareModalCtrl-specs',
  131. // 'specs/timeSrv-specs',
  132. // 'specs/panelSrv-specs',
  133. // 'specs/templateSrv-specs',
  134. // 'specs/templateValuesSrv-specs',
  135. // 'specs/kbn-format-specs',
  136. // 'specs/dashboardSrv-specs',
  137. // 'specs/dashboardViewStateSrv-specs',
  138. // 'specs/singlestat-specs',
  139. // 'specs/dynamicDashboardSrv-specs',
  140. // 'specs/unsavedChangesSrv-specs',
  141. // 'specs/value_select_dropdown_specs',
  142. // 'specs/opentsdbDatasource-specs',
  143. // 'specs/cloudwatch-datasource-specs',
  144. // 'specs/elasticsearch-specs',
  145. // 'specs/elasticsearch-querybuilder-specs',
  146. // 'specs/elasticsearch-queryctrl-specs',
  147. // 'specs/elasticsearch-indexPattern-specs',
  148. // 'specs/elasticsearch-response-specs',
  149. // 'specs/core/utils/datemath_specs',
  150. // ];
  151. //
  152. // var pluginSpecs = (config.plugins.specs || []).map(function (spec) {
  153. // return '../plugins/' + spec;
  154. // });
  155. });