karma.conf.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. module.exports = function(config) {
  19. config.set({
  20. // base path, that will be used to resolve files and exclude
  21. basePath: '',
  22. plugins: [
  23. 'karma-mocha',
  24. 'karma-chai',
  25. 'karma-sinon',
  26. 'karma-phantomjs-launcher',
  27. 'karma-coverage',
  28. 'karma-ember-precompile-brunch',
  29. 'karma-commonjs-require'
  30. ],
  31. // frameworks to use
  32. frameworks: ['mocha', 'chai', 'sinon'],
  33. // list of files / patterns to load in the browser
  34. files: [
  35. // 'public/javascripts/vendor.js',
  36. // 'public/javascripts/app.js',
  37. // 'public/test/karma_setup.js',
  38. // 'public/test/javascripts/test.js',
  39. // 'public/test/tests.js'
  40. 'node_modules/karma-commonjs-require/node_modules/commonjs-require-definition/require.js',
  41. 'vendor/scripts/console-helper.js',
  42. 'vendor/scripts/jquery-1.7.2.min.js',
  43. 'vendor/scripts/handlebars-1.0.0.beta.6.js',
  44. 'vendor/scripts/ember-latest.js',
  45. 'vendor/scripts/ember-data-latest.js',
  46. 'vendor/scripts/ember-i18n-1.4.1.js',
  47. 'vendor/scripts/bootstrap.js',
  48. 'vendor/scripts/bootstrap-combobox.js',
  49. 'vendor/scripts/bootstrap-switch.min.js',
  50. 'vendor/scripts/d3.v2.js',
  51. 'vendor/scripts/cubism.v1.js',
  52. 'vendor/scripts/jquery.ui.core.js',
  53. 'vendor/scripts/jquery.ui.position.js',
  54. 'vendor/scripts/jquery.ui.widget.js',
  55. 'vendor/scripts/jquery.ui.autocomplete.js',
  56. 'vendor/scripts/jquery.ui.mouse.js',
  57. 'vendor/scripts/jquery.ui.datepicker.js',
  58. 'vendor/scripts/jquery-ui-timepicker-addon.js',
  59. 'vendor/scripts/jquery.ui.slider.js',
  60. 'vendor/scripts/jquery.ui.sortable.js',
  61. 'vendor/scripts/jquery.ui.custom-effects.js',
  62. 'vendor/scripts/jquery.timeago.js',
  63. 'vendor/scripts/jquery.ajax-retry.js',
  64. 'vendor/scripts/difflib.js',
  65. 'vendor/scripts/diffview.js',
  66. 'vendor/scripts/underscore.js',
  67. 'vendor/scripts/backbone.js',
  68. 'vendor/scripts/visualsearch.js',
  69. 'vendor/scripts/workflow_visualization.js',
  70. 'vendor/scripts/rickshaw.js',
  71. 'vendor/scripts/spin.js',
  72. 'vendor/scripts/jquery.flexibleArea.js',
  73. 'vendor/scripts/FileSaver.js',
  74. 'vendor/scripts/Blob.js',
  75. 'vendor/scripts/moment.js',
  76. 'vendor/scripts/moment-timezone-with-data-2010-2020.js',
  77. 'vendor/**/*.js',
  78. 'app/templates/**/*.hbs',
  79. 'app!(assets)/**/!(karma_setup|tests).js',
  80. 'app/assets/test/karma_setup.js',
  81. {
  82. pattern: 'app/assets/data/**',
  83. served: true,
  84. included: false,
  85. watched: true
  86. },
  87. 'test/**/*.js',
  88. 'app/assets/test/tests.js'
  89. ],
  90. emberPrecompileBrunchPreprocessor: {
  91. jqueryPath: 'vendor/scripts/jquery-1.7.2.min.js',
  92. emberPath: 'vendor/scripts/ember-latest.js',
  93. handlebarsPath: 'vendor/scripts/handlebars-1.0.0.beta.6.js'
  94. },
  95. commonRequirePreprocessor: {
  96. appDir: 'app'
  97. },
  98. coverageReporter: {
  99. type: 'html',
  100. dir: 'public/coverage/'
  101. },
  102. preprocessors: {
  103. '!(vendor|node_modules|test)/**/!(karma_setup|tests).js': 'coverage',
  104. 'app/templates/**/*.hbs': ['ember-precompiler-brunch', 'common-require'],
  105. 'app!(assets)/**/!(karma_setup|tests).js': ['common-require'],
  106. 'test/**/*.js': ['common-require']
  107. },
  108. // list of files to exclude
  109. exclude: [
  110. ],
  111. // test results reporter to use
  112. // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
  113. // reporters: ['progress', 'coverage'],
  114. reporters: ['progress', 'coverage'],
  115. // web server port
  116. port: 9876,
  117. // enable / disable colors in the output (reporters and logs)
  118. colors: true,
  119. // level of logging
  120. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  121. logLevel: config.LOG_INFO,
  122. // enable / disable watching file and executing tests whenever any file changes
  123. autoWatch: true,
  124. // Start these browsers, currently available:
  125. // - Chrome
  126. // - ChromeCanary
  127. // - Firefox
  128. // - Opera (has to be installed with `npm install karma-opera-launcher`)
  129. // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
  130. // - PhantomJS
  131. // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
  132. browsers: ['PhantomJS'],
  133. // If browser does not capture in given timeout [ms], kill it
  134. captureTimeout: 60000,
  135. browserNoActivityTimeout: 30000,
  136. // Continuous Integration mode
  137. // if true, it capture browsers, run tests and exit
  138. singleRun: true
  139. });
  140. };