karma.conf.js 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. var webpackConfig = require('../../webpack.config.js')
  2. module.exports = function (config) {
  3. configuration = {
  4. browsers: [
  5. //'Chrome'
  6. 'ChromeHeadless'
  7. ],
  8. frameworks: [
  9. 'mocha',
  10. 'sinon-chai'
  11. ],
  12. reporters: ['spec', 'coverage'],
  13. files: ['./index.js'],
  14. preprocessors: {
  15. './index.js': ['webpack', 'sourcemap']
  16. },
  17. webpack: webpackConfig,
  18. webpackMiddleware: {
  19. noInfo: true
  20. },
  21. coverageReporter: {
  22. dir: './coverage',
  23. reporters: [
  24. { type: 'lcov', subdir: '.' },
  25. { type: 'text-summary' }
  26. ]
  27. },
  28. customLaunchers: {
  29. ChromeHeadless: {
  30. base: 'Chrome',
  31. flags: [
  32. '--headless',
  33. '--disable-gpu',
  34. // Without a remote debugging port, Google Chrome exits immediately.
  35. '--remote-debugging-port=9222',
  36. ]
  37. }
  38. }
  39. }
  40. config.set(configuration)
  41. }