karma.conf.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Karma configuration
  2. // Generated on Thu May 02 2019 12:19:56 GMT+0000 (Coordinated Universal Time)
  3. module.exports = (config) => {
  4. config.set({
  5. // base path that will be used to resolve all patterns (eg. files, exclude)
  6. // basePath: './',
  7. // urlRoot: '/',
  8. // frameworks to use
  9. // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
  10. frameworks: ['jasmine'],
  11. plugins: [
  12. 'karma-jasmine',
  13. 'karma-webpack',
  14. 'karma-chrome-launcher'
  15. ],
  16. webpack: {
  17. mode: 'development',
  18. module: {
  19. rules: [
  20. {
  21. test: /\.js$/,
  22. loader: 'babel-loader'
  23. }
  24. ]
  25. }
  26. },
  27. // list of files / patterns to load in the browser
  28. files: [
  29. './tests/unit/**/*.test.js'
  30. ],
  31. preprocessors: {
  32. './tests/unit/**/*.test.js': ['webpack']
  33. },
  34. // proxies: {
  35. // '/base/src/': './src/'
  36. // },
  37. // test results reporter to use
  38. // possible values: 'dots', 'progress'
  39. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  40. reporters: [
  41. 'progress'
  42. ],
  43. // web server port
  44. port: 9876,
  45. // enable / disable colors in the output (reporters and logs)
  46. colors: true,
  47. // level of logging
  48. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  49. logLevel: config.LOG_INFO,
  50. // enable / disable watching file and executing tests whenever any file changes
  51. autoWatch: false,
  52. // start these browsers
  53. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  54. browsers: ['ChromeHeadlessCustom'],
  55. customLaunchers: {
  56. ChromeHeadlessCustom: {
  57. base: 'ChromeHeadless',
  58. flags: ['--no-sandbox']
  59. }
  60. },
  61. // Continuous Integration mode
  62. // if true, Karma captures browsers, runs the tests and exits
  63. // singleRun: false,
  64. singleRun: true,
  65. // Concurrency level
  66. // how many browser should be started simultaneous
  67. concurrency: 8
  68. });
  69. };