karma.conf.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. var webpackConfig = require('../../build/webpack.test.conf')
  2. module.exports = function (config) {
  3. config.set({
  4. browserDisconnectTimeout: 6000,
  5. processKillTimeout: 6000,
  6. client: {
  7. mocha: {
  8. timeout: 6000
  9. }
  10. },
  11. // to run in additional browsers:
  12. // 1. install corresponding karma launcher
  13. // http://karma-runner.github.io/0.13/config/browsers.html
  14. // 2. add it to the `browsers` array below.
  15. browsers: ['PhantomJS_mobile'],
  16. customLaunchers:{
  17. PhantomJS_mobile: {
  18. base: 'PhantomJS',
  19. options: {
  20. viewportSize: {
  21. width: 375,
  22. height: 667
  23. }
  24. }
  25. }
  26. },
  27. frameworks: ['mocha', 'sinon-chai'],
  28. reporters: ['spec', 'coverage'],
  29. files: ['./index.js'],
  30. preprocessors: {
  31. './index.js': ['webpack', 'sourcemap']
  32. },
  33. webpack: webpackConfig,
  34. webpackMiddleware: {
  35. noInfo: true
  36. },
  37. coverageReporter: {
  38. dir: './coverage',
  39. reporters: [
  40. { type: 'lcov', subdir: '.' },
  41. { type: 'text-summary' }
  42. ]
  43. }
  44. })
  45. }