]>
git.proxmox.com Git - mirror_novnc.git/blob - karma.conf.js
3 module
.exports = function(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 // FIXME Skip tests in Linux since Sauce Labs browser versions are ancient.
24 // https://github.com/novnc/noVNC/pull/1013#issuecomment-382749805
25 if (platforms
[j
] === 'Linux') continue;
26 for (let k
= 0; k
< versions
.length
; k
++) {
27 let launcher_name
= 'sl_' + platforms
[j
].replace(/[^a-zA-Z0-9]/g, '') + '_' + names
[i
];
29 launcher_name
+= '_' + versions
[k
];
32 customLaunchers
[launcher_name
] = {
34 browserName
: names
[i
],
35 platform
: platforms
[j
],
39 customLaunchers
[launcher_name
].version
= versions
[k
];
45 browsers
= Object
.keys(customLaunchers
);
48 //browsers = ['PhantomJS'];
54 // base path that will be used to resolve all patterns (eg. files, exclude)
58 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
59 frameworks
: ['requirejs', 'mocha', 'chai'],
61 // list of files / patterns to load in the browser (loaded in order)
63 { pattern
: 'vendor/sinon.js', included
: false },
64 { pattern
: 'node_modules/sinon-chai/lib/sinon-chai.js', included
: false },
65 { pattern
: 'app/localization.js', included
: false },
66 { pattern
: 'app/webutil.js', included
: false },
67 { pattern
: 'core/**/*.js', included
: false },
68 { pattern
: 'vendor/pako/**/*.js', included
: false },
69 { pattern
: 'tests/test.*.js', included
: false },
70 { pattern
: 'tests/fake.*.js', included
: false },
71 { pattern
: 'tests/assertions.js', included
: false },
72 'tests/karma-test-main.js',
77 // replace Karma debug page with mocha display
83 // list of files to exclude
87 customLaunchers
: customLaunchers
,
89 // start these browsers
90 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
93 // preprocess matching files before serving them to the browser
94 // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
96 'app/localization.js': ['babel'],
97 'app/webutil.js': ['babel'],
98 'core/**/*.js': ['babel'],
99 'tests/test.*.js': ['babel'],
100 'tests/fake.*.js': ['babel'],
101 'tests/assertions.js': ['babel'],
102 'vendor/pako/**/*.js': ['babel'],
107 presets
: transpileToES5
? ['es2015'] : [],
108 plugins
: ['transform-es2015-modules-amd', 'syntax-dynamic-import'],
113 // test results reporter to use
114 // possible values: 'dots', 'progress'
115 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
116 reporters
: ['mocha'],
123 // enable / disable colors in the output (reporters and logs)
128 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
129 logLevel
: config
.LOG_INFO
,
132 // enable / disable watching file and executing tests whenever any file changes
135 // Continuous Integration mode
136 // if true, Karma captures browsers, runs the tests and exits
139 // Increase timeout in case connection is slow/we run more browsers than possible
140 // (we currently get 3 for free, and we try to run 7, so it can take a while)
141 captureTimeout
: 240000,
143 // similarly to above
144 browserNoActivityTimeout
: 100000,
148 my_conf
.reporters
.push('saucelabs');
149 my_conf
.captureTimeout
= 0; // use SL timeout
150 my_conf
.sauceLabs
= {
151 testName
: 'noVNC Tests (all)',
153 tunnelIdentifier
: process
.env
.TRAVIS_JOB_NUMBER