karma.config.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. const browsers = require('./browsers');
  2. const sauce = require('./sauce');
  3. module.exports = config => {
  4. config.set({
  5. basePath: '../',
  6. urlRoot: '/karma/',
  7. port: process.env.npm_package_config_ports_karma,
  8. files: [
  9. {
  10. pattern:
  11. 'http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js',
  12. served: true,
  13. },
  14. { pattern: 'dist/quill.snow.css', nocache: true },
  15. { pattern: 'dist/unit.js', nocache: true },
  16. { pattern: 'dist/*.map', included: false, served: true, nocache: true },
  17. { pattern: 'assets/favicon.png', included: false, served: true },
  18. ],
  19. proxies: {
  20. '/assets/': '/karma/base/assets/',
  21. },
  22. frameworks: ['jasmine'],
  23. reporters: ['progress'],
  24. colors: true,
  25. autoWatch: false,
  26. singleRun: true,
  27. browsers: ['Chrome'],
  28. client: {
  29. useIframe: true,
  30. },
  31. coverageReporter: {
  32. dir: '.coverage',
  33. reporters: [{ type: 'text' }, { type: 'html' }],
  34. },
  35. sauceLabs: {
  36. testName: 'quill-unit',
  37. options: {
  38. public: 'public',
  39. 'record-screenshots': false,
  40. },
  41. build: sauce.build,
  42. // There is no way to securely allow community PRs to be built and tested
  43. // by Travis and SauceLabs. Please do not abuse.
  44. username: 'quill',
  45. accessKey: 'ced60aed-80ad-436b-9ba8-690ed1205180',
  46. tunnelIdentifier: sauce.tunnel,
  47. },
  48. customLaunchers: browsers,
  49. });
  50. /* eslint-disable no-param-reassign */
  51. if (process.env.TRAVIS) {
  52. config.transports = ['polling'];
  53. config.browsers = [process.env.BROWSER];
  54. config.browserDisconnectTimeout = 10000;
  55. config.browserDisconnectTolerance = 3;
  56. config.browserNoActivityTimeout = 60000;
  57. config.browserSocketTimeout = 40000;
  58. config.captureTimeout = 120000;
  59. }
  60. };