]>
Commit | Line | Data |
---|---|---|
e6af0f60 SR |
1 | // Karma configuration |
2 | ||
2835616b PO |
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 | ||
651c23ec | 16 | module.exports = (config) => { |
cdb860ad | 17 | let browsers = []; |
e6af0f60 | 18 | |
2835616b PO |
19 | if (process.env.TEST_BROWSER_NAME) { |
20 | browsers = process.env.TEST_BROWSER_NAME.split(','); | |
e6af0f60 SR |
21 | } |
22 | ||
cdb860ad | 23 | const my_conf = { |
e6af0f60 SR |
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 | |
7bcdbbc6 | 30 | frameworks: ['mocha', 'sinon-chai'], |
e6af0f60 SR |
31 | |
32 | // list of files / patterns to load in the browser (loaded in order) | |
33 | files: [ | |
7279364c | 34 | { pattern: 'app/localization.js', included: false }, |
e0750f9b | 35 | { pattern: 'app/webutil.js', included: false }, |
dfae3209 SR |
36 | { pattern: 'core/**/*.js', included: false }, |
37 | { pattern: 'vendor/pako/**/*.js', included: false }, | |
7bcdbbc6 | 38 | { pattern: 'vendor/browser-es-module-loader/dist/*.js*', included: false }, |
dfae3209 SR |
39 | { pattern: 'tests/test.*.js', included: false }, |
40 | { pattern: 'tests/fake.*.js', included: false }, | |
41 | { pattern: 'tests/assertions.js', included: false }, | |
7bcdbbc6 | 42 | 'vendor/promise.js', |
dfae3209 | 43 | 'tests/karma-test-main.js', |
e6af0f60 SR |
44 | ], |
45 | ||
46 | client: { | |
47 | mocha: { | |
dfae3209 SR |
48 | // replace Karma debug page with mocha display |
49 | 'reporter': 'html', | |
e6af0f60 SR |
50 | 'ui': 'bdd' |
51 | } | |
52 | }, | |
53 | ||
54 | // list of files to exclude | |
55 | exclude: [ | |
e6af0f60 SR |
56 | ], |
57 | ||
2835616b PO |
58 | plugins: [ |
59 | 'karma-*', | |
60 | '@chiragrupani/karma-chromium-edge-launcher', | |
61 | { 'launcher:Safari': [ 'type', SafariBrowser ] }, | |
62 | ], | |
e6af0f60 SR |
63 | |
64 | // start these browsers | |
65 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | |
66 | browsers: browsers, | |
67 | ||
e6af0f60 SR |
68 | // test results reporter to use |
69 | // possible values: 'dots', 'progress' | |
70 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter | |
dfae3209 | 71 | reporters: ['mocha'], |
e6af0f60 SR |
72 | |
73 | ||
e6af0f60 SR |
74 | // level of logging |
75 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | |
76 | logLevel: config.LOG_INFO, | |
77 | ||
78 | ||
79 | // enable / disable watching file and executing tests whenever any file changes | |
80 | autoWatch: false, | |
81 | ||
82 | // Continuous Integration mode | |
83 | // if true, Karma captures browsers, runs the tests and exits | |
84 | singleRun: true, | |
e6af0f60 SR |
85 | }; |
86 | ||
e6af0f60 SR |
87 | config.set(my_conf); |
88 | }; |