karma-sauce.conf.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. module.exports = config => {
  2. const customLaunchers = {
  3. sl_chrome: {
  4. base: 'SauceLabs',
  5. browserName: 'chrome',
  6. version: '45',
  7. },
  8. sl_ios_safari: {
  9. base: 'SauceLabs',
  10. browserName: 'iPhone',
  11. version: '10.3',
  12. },
  13. };
  14. config.set({
  15. // base path that will be used to resolve all patterns (eg. files, exclude)
  16. basePath: '',
  17. // frameworks to use
  18. // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
  19. frameworks: ['mocha'],
  20. client: {
  21. mocha: {
  22. ui: 'bdd',
  23. timeout: 30000,
  24. },
  25. },
  26. // list of files / patterns to load in the browser
  27. files: ['test/browser/index.js'],
  28. // list of files / patterns to exclude
  29. exclude: [],
  30. // preprocess matching files before serving them to the browser
  31. // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
  32. preprocessors: {},
  33. // test results reporter to use
  34. // possible values: 'dots', 'progress'
  35. // available reporters: https://npmjs.org/browse/keyword/karma-reporter
  36. reporters: ['dots', 'saucelabs'],
  37. // web server port
  38. port: 9876,
  39. // enable / disable colors in the output (reporters and logs)
  40. colors: true,
  41. // level of logging
  42. // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
  43. logLevel: config.LOG_INFO,
  44. // enable / disable watching file and executing tests whenever any file changes
  45. autoWatch: false,
  46. sauceLabs: {
  47. testName: `LeanCloud Realtime SDK Test #${(
  48. process.env.TRAVIS_COMMIT || ''
  49. ).slice(0, 7)}`,
  50. recordVideo: true,
  51. connectOptions: {
  52. noSslBumpDomains: 'all',
  53. logfile: 'sauce_connect.log',
  54. },
  55. },
  56. customLaunchers,
  57. captureTimeout: 480000,
  58. browserNoActivityTimeout: 120000,
  59. // start these browsers
  60. // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
  61. browsers: Object.keys(customLaunchers),
  62. // Continuous Integration mode
  63. // if true, Karma captures browsers, runs the tests and exits
  64. singleRun: true,
  65. // Concurrency level
  66. // how many browser should be started simultaneous
  67. concurrency: 1,
  68. });
  69. };