karma.conf.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. module.exports = function(config) {
  2. var detectBrowsers = {
  3. usePhantomJS: false,
  4. // detect what browsers are installed on the system and
  5. // use headless mode and flags to allow for playback
  6. postDetection: function(browsers) {
  7. var newBrowsers = [];
  8. if (browsers.indexOf('Chrome') !== -1) {
  9. newBrowsers.push('ChromeHeadlessWithFlags');
  10. }
  11. if (browsers.indexOf('Firefox') !== -1) {
  12. newBrowsers.push('FirefoxHeadless');
  13. }
  14. return newBrowsers;
  15. }
  16. };
  17. config.set({
  18. basePath: '..',
  19. frameworks: ['browserify', 'qunit', 'detectBrowsers'],
  20. files: [
  21. 'node_modules/sinon/pkg/sinon.js',
  22. 'node_modules/sinon/pkg/sinon-ie.js',
  23. 'node_modules/video.js/dist/video.js',
  24. 'node_modules/video.js/dist/video-js.css',
  25. 'node_modules/videojs-flash/dist/videojs-flash.js',
  26. 'test/**/*.js',
  27. 'dist-test/browserify-test.js',
  28. 'dist-test/webpack-test.js'
  29. ],
  30. exclude: [
  31. 'test/bundle.js'
  32. ],
  33. preprocessors: {
  34. 'test/**/*.js': ['browserify']
  35. },
  36. customLaunchers: {
  37. ChromeHeadlessWithFlags: {
  38. base: 'ChromeHeadless',
  39. flags: [
  40. '--mute-audio',
  41. '--no-sandbox',
  42. '--no-user-gesture-required'
  43. ]
  44. }
  45. },
  46. detectBrowsers: detectBrowsers,
  47. reporters: ['dots'],
  48. port: 9876,
  49. colors: true,
  50. autoWatch: false,
  51. singleRun: true,
  52. concurrency: 1,
  53. captureTimeout: 300000,
  54. browserNoActivityTimeout: 300000,
  55. browserDisconnectTimeout: 300000,
  56. browserDisconnectTolerance: 3,
  57. browserify: {
  58. debug: true,
  59. transform: [
  60. 'babelify',
  61. 'browserify-shim'
  62. ]
  63. }
  64. });
  65. };