karma.conf.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Karma configuration
  2. // Generated on Mon Aug 24 2015 10:10:09 GMT+0000 (UTC)
  3. module.exports = function(config) {
  4. config.set({
  5. // base path that will be used to resolve all patterns (eg. files, exclude)
  6. basePath: '',
  7. // frameworks to use
  8. // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
  9. frameworks: ['jasmine', 'mocha', 'chai'],
  10. // list of files / patterns to load in the browser
  11. files: [
  12. 'public/libs/angular/angular.js',
  13. 'public/libs/angular-route/angular-route.js',
  14. 'public/libs/angular-cookies/angular-cookies.js',
  15. 'public/libs/angular-xeditable/dist/js/xeditable.min.js',
  16. 'public/libs/angular-growl-v2/build/angular-growl.min.js',
  17. 'public/libs/angular-animate/angular-animate.min.js',
  18. 'public/libs/angular-mocks/angular-mocks.js',
  19. 'public/js/**/*.js',
  20. 'public/**/*.controller.js',
  21. 'test/**/*.spec.js'
  22. ],
  23. // list of files to exclude
  24. exclude: [
  25. ],
  26. plugins: ['karma-jasmine', 'karma-mocha', 'karma-chai', 'karma-phantomjs-launcher', 'karma-coverage'],
  27. // preprocess matching files before serving them to the browser
  28. // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  29. preprocessors: {
  30. 'public/js/**/*.js': ['coverage'],
  31. 'public/**/*.controller.js': ['coverage'],
  32. },
  33. // test results reporter to use
  34. // possible values: 'dots', 'progress'
  35. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  36. reporters: ['progress', 'coverage'],
  37. coverageReporter: {
  38. type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
  39. dir: 'coverage',
  40. subdir: '.' // Output the results into ./coverage/
  41. },
  42. // web server port
  43. port: 9876,
  44. // enable / disable colors in the output (reporters and logs)
  45. colors: true,
  46. // level of logging
  47. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  48. logLevel: config.LOG_INFO,
  49. // enable / disable watching file and executing tests whenever any file changes
  50. autoWatch: true,
  51. // start these browsers
  52. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  53. browsers: ['PhantomJS'],
  54. // Continuous Integration mode
  55. // if true, Karma captures browsers, runs the tests and exits
  56. singleRun: true
  57. })
  58. }