-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkarma.conf.cjs
84 lines (62 loc) · 1.65 KB
/
karma.conf.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
module.exports = function(config) {
let cryptoTests = {
type: "module",
pattern: "karma-test-crypto/*.js"
};
let edgeClientTests = {
type: "module",
pattern: "karma-test-edge-client/*.js"
};
let files = [];
files.push(cryptoTests);
if (process.env.ZITI_EDGE_CLIENT_TESTS) {
files.push(edgeClientTests);
}
config.set(
{
envPreprocessor: [
'ZITI_EDGE_CLIENT_TESTS_USER',
'ZITI_EDGE_CLIENT_TESTS_PSWD'
],
preprocessors: {
'*/*.js': ['env']
},
frameworks: [
'mocha',
'chai',
'esm'
],
files: files,
reporters: ['progress'],
port: 9876, // karma web server port
colors: true,
logLevel: config.LOG_INFO,
browsers: [
'ZitiHeadlessChrome'
],
customLaunchers: {
ZitiHeadlessChrome: {
base: 'ChromeHeadless',
displayName: 'ZitiHeadlessChrome',
flags: [
'--disable-translate',
'--disable-extensions',
'--remote-debugging-port=9222'
]
},
},
autoWatch: false,
singleRun: true, // Karma captures browsers, runs the tests and exits
// singleRun: false, // Karma captures browsers, runs the tests and keeps browser OPEN for debugging
concurrency: Infinity,
plugins: [
require.resolve('@open-wc/karma-esm'), // make ESM work
'karma-*', // fallback: resolve any karma- plugins
'karma-env-preprocessor',
],
esm: {
nodeResolve: true,
},
}
)
}