karma.conf.js 2.2 KB

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