test-main.js 5.5 KB

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