karma.conf.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Password Management Servlets (PWM)
  3. * http://www.pwm-project.org
  4. *
  5. * Copyright (c) 2006-2009 Novell, Inc.
  6. * Copyright (c) 2009-2017 The PWM Project
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. var webpackConfig = require('./webpack.test.js');
  23. module.exports = function (config) {
  24. config.set({
  25. // base path that will be used to resolve all patterns (eg. files, exclude)
  26. basePath: '',
  27. // frameworks to use
  28. // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
  29. frameworks: [ 'jasmine' ],
  30. // list of files / patterns to load in the browser
  31. // Don't forget to add this to webpack.dev.js
  32. files: [
  33. 'node_modules/angular/angular.js',
  34. 'node_modules/angular-mocks/angular-mocks.js',
  35. 'node_modules/angular-translate/dist/angular-translate.js',
  36. 'vendor/angular-ui-router.js',
  37. 'src/main.ts',
  38. 'src/**/*.test.ts'
  39. ],
  40. exclude: [
  41. ],
  42. // preprocess matching files before serving them to the browser
  43. // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  44. preprocessors: {
  45. 'src/main.ts': ['webpack'],
  46. 'src/**/*.test.ts': ['webpack']
  47. },
  48. // webpack configuration
  49. webpack: webpackConfig,
  50. webpackMiddleware: {
  51. // display no info to console (only warnings and errors)
  52. noInfo: true,
  53. stats: {
  54. colors: true
  55. }
  56. },
  57. // test results reporter to use
  58. // possible values: 'dots', 'progress'
  59. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  60. reporters: ['progress'],
  61. // web server port
  62. port: 9876,
  63. // enable / disable colors in the output (reporters and logs)
  64. colors: true,
  65. // level of logging
  66. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  67. logLevel: config.LOG_INFO,
  68. // enable / disable watching file and executing tests whenever any file changes
  69. autoWatch: true,
  70. // start these browsers
  71. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  72. browsers: [ 'PhantomJS' ],
  73. // Continuous Integration mode
  74. // if true, Karma captures browsers, runs the tests and exits
  75. singleRun: false,
  76. // Concurrency level
  77. // how many browser should be started simultaneous
  78. concurrency: Infinity
  79. })
  80. };