karma-ci.conf.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Karma configuration file, see link for more information
  2. // https://karma-runner.github.io/1.0/config/configuration-file.html
  3. //process.env.CHROME_BIN = '/usr/bin/google-chrome'
  4. // Karma configuration file, see link for more information
  5. // https://karma-runner.github.io/1.0/config/configuration-file.html
  6. //process.env.CHROME_BIN = '/usr/bin/google-chrome'
  7. // Karma configuration file, see link for more information
  8. // https://karma-runner.github.io/1.0/config/configuration-file.html
  9. //process.env.CHROME_BIN = '/usr/bin/google-chrome'
  10. module.exports = function (config) {
  11. config.set({
  12. basePath: '',
  13. frameworks: ['jasmine', '@angular-devkit/build-angular'],
  14. plugins: [
  15. require('karma-jasmine'),
  16. require('karma-chrome-launcher'),
  17. require('karma-jasmine-html-reporter'),
  18. require('karma-coverage-istanbul-reporter'),
  19. require('@angular-devkit/build-angular/plugins/karma'),
  20. require('karma-junit-reporter'),
  21. require('karma-coverage'),
  22. require('karma-jenkins-reporter')
  23. ],
  24. client:{
  25. clearContext: false // leave Jasmine Spec Runner output visible in browser
  26. },
  27. coverageIstanbulReporter: {
  28. reports: [ 'html', 'lcovonly'],
  29. fixWebpackSourcePaths: true
  30. },
  31. // changes type to `cobertura`
  32. coverageReporter: {
  33. type: 'cobertura',
  34. dir: 'target/coverage-reports/'
  35. },
  36. // saves report at `target/surefire-reports/TEST-*.xml` because Jenkins
  37. // looks for this location and file prefix by default.
  38. junitReporter: {
  39. outputDir: 'target/surefire-reports/TESTS-TestSuite.xml'
  40. },
  41. angularCli: {
  42. environment: 'test'
  43. },
  44. reporters: ['progress', 'kjhtml', 'junit'],
  45. browsers: ['ChromeHeadless'],
  46. customLaunchers: {
  47. ChromeHeadlessCI: {
  48. base: 'ChromeHeadless',
  49. flags: ['--no-sandbox']
  50. }
  51. },
  52. logLevel: config.LOG_ERROR,
  53. autoWatch: false,
  54. singleRun: true,
  55. browserNoActivityTimeout: 40000,
  56. concurrency: Infinity,
  57. });
  58. };