karma.conf.js 671 B

12345678910111213141516171819202122232425262728293031
  1. const webpackConfig = require('../../build/webpack.test');
  2. module.exports = function(config) {
  3. const configuration = {
  4. browsers: ['ChromeHeadless'],
  5. frameworks: ['mocha', 'sinon-chai'],
  6. reporters: ['spec', 'coverage'],
  7. files: ['./index.js'],
  8. preprocessors: {
  9. './index.js': ['webpack', 'sourcemap']
  10. },
  11. webpack: webpackConfig,
  12. webpackMiddleware: {
  13. noInfo: true
  14. },
  15. coverageReporter: {
  16. dir: './coverage',
  17. reporters: [
  18. { type: 'lcov', subdir: '.' },
  19. { type: 'text-summary' }
  20. ]
  21. },
  22. client: {
  23. mocha: {
  24. timeout: 4000
  25. }
  26. }
  27. };
  28. config.set(configuration);
  29. };