]>
git.proxmox.com Git - mirror_novnc.git/blob - karma.conf.js
3 module
.exports
= (config
) => {
4 const customLaunchers
= {};
7 let transpileToES5
= ['internet explorer'].includes(process
.env
.TEST_BROWSER_NAME
);
9 // use Sauce when running on Travis
10 if (process
.env
.TRAVIS_JOB_NUMBER
) {
14 if (useSauce
&& process
.env
.TEST_BROWSER_NAME
&& process
.env
.TEST_BROWSER_NAME
!= 'PhantomJS') {
15 const names
= process
.env
.TEST_BROWSER_NAME
.split(',');
16 const platforms
= process
.env
.TEST_BROWSER_OS
.split(',');
17 const versions
= process
.env
.TEST_BROWSER_VERSION
18 ? process
.env
.TEST_BROWSER_VERSION
.split(',')
21 for (let i
= 0; i
< names
.length
; i
++) {
22 for (let j
= 0; j
< platforms
.length
; j
++) {
23 for (let k
= 0; k
< versions
.length
; k
++) {
24 let launcher_name
= 'sl_' + platforms
[j
].replace(/[^a-zA-Z0-9]/g, '') + '_' + names
[i
];
26 launcher_name
+= '_' + versions
[k
];
29 customLaunchers
[launcher_name
] = {
31 browserName
: names
[i
],
32 platform
: platforms
[j
],
36 customLaunchers
[launcher_name
].version
= versions
[k
];
42 browsers
= Object
.keys(customLaunchers
);
45 //browsers = ['PhantomJS'];
51 // base path that will be used to resolve all patterns (eg. files, exclude)
55 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
56 frameworks
: ['requirejs', 'mocha', 'sinon-chai'],
58 // list of files / patterns to load in the browser (loaded in order)
60 { pattern
: 'app/localization.js', included
: false },
61 { pattern
: 'app/webutil.js', included
: false },
62 { pattern
: 'core/**/*.js', included
: false },
63 { pattern
: 'vendor/pako/**/*.js', included
: false },
64 { pattern
: 'tests/test.*.js', included
: false },
65 { pattern
: 'tests/fake.*.js', included
: false },
66 { pattern
: 'tests/assertions.js', included
: false },
67 'tests/karma-test-main.js',
72 // replace Karma debug page with mocha display
78 // list of files to exclude
82 customLaunchers
: customLaunchers
,
84 // start these browsers
85 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
88 // preprocess matching files before serving them to the browser
89 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
91 'app/localization.js': ['babel'],
92 'app/webutil.js': ['babel'],
93 'core/**/*.js': ['babel'],
94 'tests/test.*.js': ['babel'],
95 'tests/fake.*.js': ['babel'],
96 'tests/assertions.js': ['babel'],
97 'vendor/pako/**/*.js': ['babel'],
102 presets
: transpileToES5
? ['es2015'] : [],
103 plugins
: ['transform-es2015-modules-amd', 'syntax-dynamic-import'],
108 // test results reporter to use
109 // possible values: 'dots', 'progress'
110 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
111 reporters
: ['mocha'],
118 // enable / disable colors in the output (reporters and logs)
123 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
124 logLevel
: config
.LOG_INFO
,
127 // enable / disable watching file and executing tests whenever any file changes
130 // Continuous Integration mode
131 // if true, Karma captures browsers, runs the tests and exits
134 // Increase timeout in case connection is slow/we run more browsers than possible
135 // (we currently get 3 for free, and we try to run 7, so it can take a while)
136 captureTimeout
: 240000,
138 // similarly to above
139 browserNoActivityTimeout
: 100000,
143 my_conf
.reporters
.push('saucelabs');
144 my_conf
.captureTimeout
= 0; // use SL timeout
145 my_conf
.sauceLabs
= {
146 testName
: 'noVNC Tests (all)',
148 tunnelIdentifier
: process
.env
.TRAVIS_JOB_NUMBER