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