karma.conf.js 719 B

123456789101112131415161718192021222324252627282930313233343536
  1. var webpackConfig = require('./webpack.config.js');
  2. module.exports = function (karma) {
  3. karma.set({
  4. plugins: [
  5. 'karma-webpack',
  6. 'karma-chai',
  7. 'karma-sinon',
  8. 'karma-mocha',
  9. 'karma-chrome-launcher',
  10. ],
  11. frameworks: ['chai', 'sinon', 'mocha', 'webpack'],
  12. files: [
  13. { pattern: 'src/**/*.js', watched: false },
  14. { pattern: 'test/**/*.js', watched: false },
  15. ],
  16. preprocessors: {
  17. 'src/**/*.js': ['webpack'],
  18. 'test/**/*.js': ['webpack'],
  19. },
  20. webpack: {
  21. module: webpackConfig.module,
  22. plugins: webpackConfig.plugins,
  23. },
  24. webpackMiddleware: {
  25. stats: 'errors-only',
  26. },
  27. browsers: ['ChromeHeadless'],
  28. });
  29. };