-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathkarma.config.js
More file actions
40 lines (39 loc) · 1.01 KB
/
karma.config.js
File metadata and controls
40 lines (39 loc) · 1.01 KB
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
// Use system Chrome/Chromium if available, otherwise let Karma find it
// In CI environments, CHROME_BIN should be set or the system Chrome should be in PATH
if (!process.env.CHROME_BIN) {
try {
const chromiumPath = require('chromium').path
if (chromiumPath) {
process.env.CHROME_BIN = chromiumPath
}
} catch (e) {
// If chromium package doesn't work, let Karma use system Chrome
}
}
module.exports = function (config) {
config.set({
frameworks: ['mocha', 'chai'],
files: [
{ pattern: 'dist/index.js', type: 'module' },
{ pattern: 'test/test.js', type: 'module' }
],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadlessCI'],
customLaunchers: {
ChromeHeadlessCI: {
base: 'ChromeHeadless',
flags: [
'--no-sandbox',
'--disable-gpu',
'--disable-dev-shm-usage'
]
}
},
autoWatch: false,
singleRun: true,
concurrency: Infinity
})
}