karma.conf.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. var path = require('path'),
  2. APP_CONFIG = require('config');
  3. module.exports = function(config) {
  4. function bowerPath(dir) {
  5. return path.join(APP_CONFIG.bowerPath, dir);
  6. }
  7. function appPath(dir) {
  8. return path.join(APP_CONFIG.appPath, dir);
  9. }
  10. function testPath(dir) {
  11. return path.join(APP_CONFIG.testPath, dir);
  12. }
  13. config.set({
  14. // Base path, that will be used to resolve files and exclude.
  15. basePath: __dirname,
  16. // Test framework to use.
  17. frameworks: ['jasmine'],
  18. // list of files / patterns to load in the browser
  19. files: [
  20. // TODO: programatically generate list of bower components
  21. bowerPath('/angular/angular.js'),
  22. bowerPath('/angular-route/angular-route.js'),
  23. bowerPath('/angular-resource/angular-resource.js'),
  24. bowerPath('/angular-animate/angular-animate.js'),
  25. bowerPath('/angular-mocks/angular-mocks.js'),
  26. bowerPath('/angular-bootstrap/ui-bootstrap-tpls.js'),
  27. bowerPath('/underscore/underscore.js'),
  28. bowerPath('/underscore.string/lib/underscore.string.js'),
  29. bowerPath('/jquery/dist/jquery.js'),
  30. bowerPath('/d3/d3.js'),
  31. // Tests & test helper files.
  32. testPath('/util/**/*.js'),
  33. testPath('/mock/**/*.js'),
  34. testPath('/**/*.spec.js'),
  35. // Actual client-side code.
  36. appPath('/*.js'),
  37. appPath('/compiled/*.js'),
  38. appPath('/{directive,module,service,filter,coreos}/**/*.js')
  39. ],
  40. reporters: ['progress'],
  41. // web server port
  42. port: 8100,
  43. // cli runner port
  44. runnerPort: 9100,
  45. colors: true,
  46. // LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG
  47. logLevel: config.LOG_INFO,
  48. autoWatch: false,
  49. browsers: ['Chrome'],
  50. // If browser does not capture in given timeout [ms], kill it
  51. captureTimeout: 5000,
  52. // Continuous Integration mode.
  53. // If true, it capture browsers, run tests and exit.
  54. singleRun: true
  55. });
  56. };