karma.conf.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. require('babel-register');
  2. var webpackConfig = require('./webpack.config.babel.js').default({ test: true });
  3. module.exports = function (config) {
  4. var configuration = {
  5. basePath: '',
  6. frameworks: [
  7. 'jasmine',
  8. 'jasmine-matchers'
  9. ],
  10. hostname: 'localhost',
  11. port: 9876,
  12. singleRun: true,
  13. autoWatch: false,
  14. files: [
  15. {
  16. pattern: 'spec/support/demo.wav',
  17. included: false,
  18. watched: false,
  19. served: true
  20. },
  21. // specs
  22. 'spec/plugin-api.spec.js',
  23. 'spec/util.spec.js',
  24. 'spec/wavesurfer.spec.js',
  25. 'spec/peakcache.spec.js'
  26. ],
  27. preprocessors: {
  28. 'spec/plugin-api.spec.js': ['webpack'],
  29. 'spec/util.spec.js': ['webpack'],
  30. 'spec/wavesurfer.spec.js': ['webpack'],
  31. 'spec/peakcache.spec.js': ['webpack']
  32. },
  33. webpackMiddleware: {
  34. stats: 'errors-only'
  35. },
  36. plugins: [
  37. 'karma-webpack',
  38. 'karma-jasmine',
  39. 'karma-jasmine-matchers',
  40. 'karma-chrome-launcher'
  41. ],
  42. browsers: [
  43. 'Chrome'
  44. ],
  45. captureConsole: true,
  46. colors: true,
  47. reporters: ['progress'],
  48. webpack: webpackConfig,
  49. customLaunchers: {
  50. Chrome_travis_ci: {
  51. base: 'Chrome',
  52. flags: ['--no-sandbox']
  53. }
  54. }
  55. };
  56. if (process.env.TRAVIS) {
  57. configuration.browsers = ['Chrome_travis_ci'];
  58. }
  59. config.set(configuration);
  60. };