karma.conf.js 867 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. const webpackConfig = require('../../build/webpack.test');
  2. module.exports = function(config) {
  3. const configuration = {
  4. browsers: ['Chrome'],
  5. customLaunchers: {
  6. Chrome_travis_ci: {
  7. base: 'Chrome',
  8. flags: ['--no-sandbox']
  9. }
  10. },
  11. frameworks: ['mocha', 'sinon-chai'],
  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. client: {
  29. mocha: {
  30. timeout: 4000
  31. }
  32. }
  33. };
  34. if (process.env.TRAVIS) {
  35. configuration.browsers = ['Chrome_travis_ci'];
  36. }
  37. config.set(configuration);
  38. };