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