karma.coverage.conf.js 860B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module.exports = function(config) {
  2. var configuration = {
  3. browsers: ['Firefox'],
  4. frameworks: ['browserify', 'jasmine'],
  5. preprocessors: {
  6. 'src/**/*.js': ['browserify']
  7. },
  8. browserify: {
  9. debug: true,
  10. transform: [['browserify-istanbul', {
  11. instrumenterConfig: {
  12. embed: true
  13. }
  14. }]]
  15. },
  16. reporters: ['progress', 'coverage'],
  17. coverageReporter: {
  18. dir: 'coverage/',
  19. reporters: [
  20. { type: 'html', subdir: 'report-html' },
  21. { type: 'lcovonly', subdir: '.', file: 'lcov.info' }
  22. ]
  23. }
  24. };
  25. // If on the CI, use the CI chrome launcher
  26. if (process.env.TRAVIS) {
  27. configuration.browsers.push('Chrome_travis_ci');
  28. configuration.customLaunchers = {
  29. Chrome_travis_ci: {
  30. base: 'Chrome',
  31. flags: ['--no-sandbox']
  32. }
  33. };
  34. } else {
  35. configuration.browsers.push('Chrome');
  36. }
  37. config.set(configuration);
  38. };