karma.conf.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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-mocks/angular-mocks.js',
  17. 'public/js/**/*.js',
  18. 'public/**/*.controller.js',
  19. 'test/**/*.spec.js'
  20. ],
  21. // list of files to exclude
  22. exclude: [
  23. ],
  24. plugins: ['karma-jasmine', 'karma-mocha', 'karma-chai', 'karma-phantomjs-launcher', 'karma-coverage'],
  25. // preprocess matching files before serving them to the browser
  26. // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  27. preprocessors: {
  28. 'public/js/**/*.js': ['coverage'],
  29. 'public/**/*.controller.js': ['coverage'],
  30. },
  31. // test results reporter to use
  32. // possible values: 'dots', 'progress'
  33. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  34. reporters: ['progress', 'coverage'],
  35. coverageReporter: {
  36. type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
  37. dir: 'coverage',
  38. subdir: '.' // Output the results into ./coverage/
  39. },
  40. // web server port
  41. port: 9876,
  42. // enable / disable colors in the output (reporters and logs)
  43. colors: true,
  44. // level of logging
  45. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  46. logLevel: config.LOG_INFO,
  47. // enable / disable watching file and executing tests whenever any file changes
  48. autoWatch: true,
  49. // start these browsers
  50. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  51. browsers: ['PhantomJS'],
  52. // Continuous Integration mode
  53. // if true, Karma captures browsers, runs the tests and exits
  54. singleRun: true
  55. })
  56. }