]> git.proxmox.com Git - mirror_novnc.git/blob - karma.conf.js
feat: add French localization strings
[mirror_novnc.git] / karma.conf.js
1 // Karma configuration
2
3 // The Safari launcher is broken, so construct our own
4 function SafariBrowser(id, baseBrowserDecorator, args) {
5 baseBrowserDecorator(this);
6
7 this._start = function(url) {
8 this._execCommand('/usr/bin/open', ['-W', '-n', '-a', 'Safari', url]);
9 }
10 }
11
12 SafariBrowser.prototype = {
13 name: 'Safari'
14 }
15
16 module.exports = (config) => {
17 let browsers = [];
18
19 if (process.env.TEST_BROWSER_NAME) {
20 browsers = process.env.TEST_BROWSER_NAME.split(',');
21 }
22
23 const my_conf = {
24
25 // base path that will be used to resolve all patterns (eg. files, exclude)
26 basePath: '',
27
28 // frameworks to use
29 // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
30 frameworks: ['mocha', 'sinon-chai'],
31
32 // list of files / patterns to load in the browser (loaded in order)
33 files: [
34 { pattern: 'app/localization.js', included: false, type: 'module' },
35 { pattern: 'app/webutil.js', included: false, type: 'module' },
36 { pattern: 'core/**/*.js', included: false, type: 'module' },
37 { pattern: 'vendor/pako/**/*.js', included: false, type: 'module' },
38 { pattern: 'tests/test.*.js', type: 'module' },
39 { pattern: 'tests/fake.*.js', included: false, type: 'module' },
40 { pattern: 'tests/assertions.js', type: 'module' },
41 ],
42
43 client: {
44 mocha: {
45 // replace Karma debug page with mocha display
46 'reporter': 'html',
47 'ui': 'bdd'
48 }
49 },
50
51 // list of files to exclude
52 exclude: [
53 ],
54
55 plugins: [
56 'karma-*',
57 '@chiragrupani/karma-chromium-edge-launcher',
58 { 'launcher:Safari': [ 'type', SafariBrowser ] },
59 ],
60
61 // start these browsers
62 // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
63 browsers: browsers,
64
65 // test results reporter to use
66 // possible values: 'dots', 'progress'
67 // available reporters: https://npmjs.org/browse/keyword/karma-reporter
68 reporters: ['mocha'],
69
70
71 // level of logging
72 // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
73 logLevel: config.LOG_INFO,
74
75
76 // enable / disable watching file and executing tests whenever any file changes
77 autoWatch: false,
78
79 // Continuous Integration mode
80 // if true, Karma captures browsers, runs the tests and exits
81 singleRun: true,
82 };
83
84 config.set(my_conf);
85 };