karma.conf.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Karma configuration file, see link for more information
  2. // https://karma-runner.github.io/1.0/config/configuration-file.html
  3. module.exports = function (config) {
  4. const configuration = {
  5. basePath: '',
  6. frameworks: ['jasmine', '@angular-devkit/build-angular'],
  7. plugins: [
  8. require('karma-jasmine'),
  9. require('karma-chrome-launcher'),
  10. require('karma-jasmine-html-reporter'),
  11. require('karma-coverage-istanbul-reporter'),
  12. require('@angular-devkit/build-angular/plugins/karma')
  13. ],
  14. client:{
  15. clearContext: false // leave Jasmine Spec Runner output visible in browser
  16. },
  17. coverageIstanbulReporter: {
  18. dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
  19. fixWebpackSourcePaths: true
  20. },
  21. angularCli: {
  22. environment: 'dev'
  23. },
  24. reporters: ['progress', 'kjhtml'],
  25. port: 9876,
  26. colors: true,
  27. logLevel: config.LOG_INFO,
  28. autoWatch: true,
  29. browsers: ['Chrome'],
  30. customLaunchers: {
  31. Chrome_travis_ci: {
  32. base: 'Chrome',
  33. flags: ['--no-sandbox']
  34. }
  35. },
  36. singleRun: false
  37. };
  38. if (process.env.TRAVIS) {
  39. configuration.browsers = ['Chrome_travis_ci'];
  40. }
  41. config.set(configuration);
  42. };