karma.conf.js 1.4 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. config.set({
  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. require('karma-junit-reporter'),
  14. require('karma-coverage'),
  15. require('karma-jenkins-reporter')
  16. ],
  17. client:{
  18. clearContext: false // leave Jasmine Spec Runner output visible in browser
  19. },
  20. coverageIstanbulReporter: {
  21. reports: [ 'html', 'lcovonly'],
  22. fixWebpackSourcePaths: true
  23. },
  24. // changes type to `cobertura`
  25. coverageReporter: {
  26. type: 'cobertura',
  27. dir: 'target/coverage-reports/'
  28. },
  29. // saves report at `target/surefire-reports/TEST-*.xml` because Jenkins
  30. // looks for this location and file prefix by default.
  31. junitReporter: {
  32. outputDir: 'target/surefire-reports/TESTS-TestSuite.xml'
  33. },
  34. angularCli: {
  35. environment: 'test'
  36. },
  37. reporters: ['progress', 'kjhtml', 'junit'],
  38. port: 9876,
  39. colors: true,
  40. logLevel: config.LOG_INFO,
  41. autoWatch: true,
  42. browsers: ['Chrome'],
  43. singleRun: true
  44. });
  45. };