karma.conf.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. var webpackConfig = require('../../build/cooking.test');
  2. // no need for app entry during tests
  3. // delete webpackConfig.entry;
  4. module.exports = function(config) {
  5. var configuration = {
  6. // to run in additional browsers:
  7. // 1. install corresponding karma launcher
  8. // http://karma-runner.github.io/0.13/config/browsers.html
  9. // 2. add it to the `browsers` array below.
  10. browsers: ['Chrome'],
  11. customLaunchers: {
  12. Chrome_travis_ci: {
  13. base: 'Chrome',
  14. flags: ['--no-sandbox']
  15. }
  16. },
  17. frameworks: ['mocha', 'sinon-chai'],
  18. reporters: ['spec', 'coverage'],
  19. files: ['./index.js'],
  20. preprocessors: {
  21. './index.js': ['webpack', 'sourcemap']
  22. },
  23. webpack: webpackConfig,
  24. webpackMiddleware: {
  25. noInfo: true
  26. },
  27. coverageReporter: {
  28. dir: './coverage',
  29. reporters: [
  30. { type: 'lcov', subdir: '.' },
  31. { type: 'text-summary' }
  32. ]
  33. },
  34. client: {
  35. mocha: {
  36. timeout: 4000
  37. }
  38. }
  39. };
  40. if (process.env.TRAVIS) {
  41. configuration.browsers = ['Chrome_travis_ci'];
  42. }
  43. config.set(configuration);
  44. };