karma.conf.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. module.exports = function (karma) {
  2. karma.set({
  3. // base path, that will be used to resolve files and exclude
  4. basePath: './',
  5. frameworks: ['mocha'],
  6. preprocessors: {
  7. 'test/fixtures/*.html': ['html2js'],
  8. '**/src/*.js': 'coverage'
  9. },
  10. // list of files / patterns to load in the browser
  11. files: [
  12. {pattern: 'node_modules/chai/chai.js', include: true},
  13. {pattern: '3rdparty/jquery.min.js', served: true, included: true},
  14. {pattern: 'build/appframework.ui.js',served: true, included: true},
  15. {pattern: 'test/chai.helper.js', include: true},
  16. 'build/af.ui.css',
  17. 'test/fixtures/*.html',
  18. 'test/*.test.js'
  19. /*'test/drawer.test.js'*/
  20. ],
  21. // list of files to exclude
  22. exclude: [
  23. 'karma.conf.js'
  24. ],
  25. // use dots reporter, as travis terminal does not support escaping sequences
  26. // possible values: 'dots', 'progress', 'junit', 'teamcity'
  27. // CLI --reporters progress
  28. reporters: ['progress', 'coverage'],
  29. //Code Coverage options. report type available:
  30. //- html (default)
  31. //- lcov (lcov and html)
  32. //- lcovonly
  33. //- text (standard output)
  34. //- text-summary (standard output)
  35. //- cobertura (xml format supported by Jenkins)
  36. coverageReporter: {
  37. // cf. http://gotwarlost.github.com/istanbul/public/apidocs/
  38. type: 'html',
  39. dir: 'coverage/'
  40. },
  41. // web server port
  42. port: 9876,
  43. // cli runner port
  44. runnerPort: 9100,
  45. // enable / disable colors in the output (reporters and logs)
  46. colors: true,
  47. // level of logging
  48. // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
  49. //logLevel: LOG_DEBUG,
  50. // enable / disable watching file and executing tests whenever any file changes
  51. autoWatch: false,
  52. // Start these browsers, currently available:
  53. // - Chrome
  54. // - ChromeCanary
  55. // - Firefox
  56. // - Opera
  57. // - Safari (only Mac)
  58. // - PhantomJS
  59. // - IE (only Windows)
  60. // CLI --browsers Chrome,Firefox,Safari
  61. browsers: ['Chrome'],
  62. // If browser does not capture in given timeout [ms], kill it
  63. captureTimeout: 6000,
  64. // Continuous Integration mode
  65. // if true, it capture browsers, run tests and exit
  66. singleRun: true,
  67. plugins: [
  68. 'karma-mocha',
  69. 'karma-chrome-launcher',
  70. 'karma-coverage',
  71. 'karma-htmlfile-reporter',
  72. 'karma-html2js-preprocessor'
  73. ]
  74. });
  75. }