karma.config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. var browsers = require('./browsers');
  2. var sauce = require('./sauce');
  3. module.exports = function(config) {
  4. config.set({
  5. basePath: '../',
  6. urlRoot: '/karma/',
  7. port: process.env.npm_package_config_ports_karma,
  8. files: [
  9. { pattern: 'dist/quill.snow.css', nocache: true },
  10. { pattern: 'dist/unit.js', nocache: true },
  11. { pattern: 'dist/*.map', included: false, served: true, nocache: true },
  12. { pattern: 'assets/favicon.png', included: false, served: true }
  13. ],
  14. proxies: {
  15. '/assets/': '/karma/base/assets/'
  16. },
  17. frameworks: ['jasmine'],
  18. reporters: ['progress'],
  19. colors: true,
  20. autoWatch: false,
  21. singleRun: true,
  22. browsers: ['Chrome'],
  23. client: {
  24. useIframe: false
  25. },
  26. coverageReporter: {
  27. dir: '.coverage',
  28. reporters: [
  29. { type: 'text' },
  30. { type: 'html' }
  31. ]
  32. },
  33. sauceLabs: {
  34. testName: 'quill-unit',
  35. options: {
  36. 'public': 'public',
  37. 'record-screenshots': false
  38. },
  39. build: sauce.build,
  40. username: sauce.username,
  41. accessKey: sauce.accessKey,
  42. tunnelIdentifier: sauce.tunnel
  43. },
  44. customLaunchers: browsers
  45. });
  46. if (process.env.TRAVIS) {
  47. config.sauceLabs.startConnect = false;
  48. config.transports = ['polling'];
  49. config.browsers = [process.env.BROWSER];
  50. config.browserDisconnectTimeout = 10000;
  51. config.browserDisconnectTolerance = 3;
  52. config.browserNoActivityTimeout = 60000;
  53. config.captureTimeout = 120000;
  54. // MS Edge does not work in an iframe
  55. if (process.env.BROWSER.indexOf('ios') > -1 ||
  56. process.env.BROWSER.indexOf('android') > -1 ||
  57. process.env.BROWSER.indexOf('firefox') > -1) {
  58. config.client.useIframe = true;
  59. }
  60. }
  61. };