karma.conf.js 1.4 KB

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