test-main.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. require.config({
  2. baseUrl: 'http://localhost:9876/base/src/app',
  3. paths: {
  4. specs: '../test/specs',
  5. mocks: '../test/mocks',
  6. config: '../config.sample',
  7. kbn: 'components/kbn',
  8. settings: 'components/settings',
  9. lodash: 'components/lodash.extended',
  10. 'lodash-src': '../vendor/lodash',
  11. moment: '../vendor/moment',
  12. chromath: '../vendor/chromath',
  13. filesaver: '../vendor/filesaver',
  14. angular: '../vendor/angular/angular',
  15. 'angular-route': '../vendor/angular/angular-route',
  16. angularMocks: '../vendor/angular/angular-mocks',
  17. 'angular-dragdrop': '../vendor/angular/angular-dragdrop',
  18. 'angular-strap': '../vendor/angular/angular-strap',
  19. timepicker: '../vendor/angular/timepicker',
  20. datepicker: '../vendor/angular/datepicker',
  21. bindonce: '../vendor/angular/bindonce',
  22. crypto: '../vendor/crypto.min',
  23. spectrum: '../vendor/spectrum',
  24. jquery: '../vendor/jquery/jquery-1.8.0',
  25. bootstrap: '../vendor/bootstrap/bootstrap',
  26. 'bootstrap-tagsinput': '../vendor/tagsinput/bootstrap-tagsinput',
  27. 'jquery-ui': '../vendor/jquery/jquery-ui-1.10.3',
  28. 'extend-jquery': 'components/extend-jquery',
  29. 'jquery.flot': '../vendor/jquery/jquery.flot',
  30. 'jquery.flot.pie': '../vendor/jquery/jquery.flot.pie',
  31. 'jquery.flot.events': '../vendor/jquery/jquery.flot.events',
  32. 'jquery.flot.selection': '../vendor/jquery/jquery.flot.selection',
  33. 'jquery.flot.stack': '../vendor/jquery/jquery.flot.stack',
  34. 'jquery.flot.stackpercent':'../vendor/jquery/jquery.flot.stackpercent',
  35. 'jquery.flot.time': '../vendor/jquery/jquery.flot.time',
  36. modernizr: '../vendor/modernizr-2.6.1',
  37. },
  38. shim: {
  39. bootstrap: {
  40. deps: ['jquery']
  41. },
  42. modernizr: {
  43. exports: 'Modernizr'
  44. },
  45. angular: {
  46. deps: ['jquery', 'config'],
  47. exports: 'angular'
  48. },
  49. angularMocks: {
  50. deps: ['angular'],
  51. },
  52. crypto: {
  53. exports: 'Crypto'
  54. },
  55. 'jquery-ui': ['jquery'],
  56. 'jquery.flot': ['jquery'],
  57. 'jquery.flot.pie': ['jquery', 'jquery.flot'],
  58. 'jquery.flot.events': ['jquery', 'jquery.flot'],
  59. 'jquery.flot.selection':['jquery', 'jquery.flot'],
  60. 'jquery.flot.stack': ['jquery', 'jquery.flot'],
  61. 'jquery.flot.stackpercent':['jquery', 'jquery.flot'],
  62. 'jquery.flot.time': ['jquery', 'jquery.flot'],
  63. 'angular-route': ['angular'],
  64. 'angular-cookies': ['angular'],
  65. 'angular-dragdrop': ['jquery','jquery-ui','angular'],
  66. 'angular-loader': ['angular'],
  67. 'angular-mocks': ['angular'],
  68. 'angular-resource': ['angular'],
  69. 'angular-touch': ['angular'],
  70. 'bindonce': ['angular'],
  71. 'angular-strap': ['angular', 'bootstrap','timepicker', 'datepicker'],
  72. 'bootstrap-tagsinput': ['jquery'],
  73. timepicker: ['jquery', 'bootstrap'],
  74. datepicker: ['jquery', 'bootstrap'],
  75. }
  76. });
  77. require([
  78. 'angular',
  79. 'angularMocks',
  80. 'app',
  81. ], function(angular) {
  82. 'use strict';
  83. for (var file in window.__karma__.files) {
  84. if (/spec\.js$/.test(file)) {
  85. window.tests.push(file.replace(/^\/base\//, 'http://localhost:9876/base/'));
  86. }
  87. }
  88. angular.module('grafana', ['ngRoute']);
  89. angular.module('grafana.services', ['ngRoute', '$strap.directives']);
  90. angular.module('grafana.panels', []);
  91. angular.module('grafana.filters', []);
  92. require([
  93. 'specs/lexer-specs',
  94. 'specs/parser-specs',
  95. 'specs/gfunc-specs',
  96. 'specs/graphiteTargetCtrl-specs',
  97. 'specs/graph-ctrl-specs',
  98. 'specs/filterSrv-specs',
  99. 'specs/kbn-format-specs',
  100. 'specs/dashboardSrv-specs',
  101. 'specs/influxSeries-specs',
  102. 'specs/overview-ctrl-specs',
  103. ], function () {
  104. window.__karma__.start();
  105. });
  106. });