-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathkarma.conf.js
64 lines (60 loc) · 1.83 KB
/
karma.conf.js
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
require('dotenv').config();
module.exports = function (config) {
// Mocha configuration
const mocha = {
timeout: '30000ms',
};
// If a test grep is provided, only run the tests that match the grep.
if (process.env.TEST_GREP) {
mocha.grep = process.env.TEST_GREP;
}
var configuration = {
frameworks: ['mocha'],
client: {
mocha,
env: {
FLAT_EMBED_APP_ID: process.env.FLAT_EMBED_APP_ID,
FLAT_EMBED_BASE_URL: process.env.FLAT_EMBED_BASE_URL,
FLAT_EMBED_PUBLIC_SCORE: process.env.FLAT_EMBED_PUBLIC_SCORE,
FLAT_EMBED_QUARTET_SCORE: process.env.FLAT_EMBED_QUARTET_SCORE,
FLAT_EMBED_PRIVATE_LINK_SCORE: process.env.FLAT_EMBED_PRIVATE_LINK_SCORE,
FLAT_EMBED_PRIVATE_LINK_SHARING_KEY: process.env.FLAT_EMBED_PRIVATE_LINK_SHARING_KEY,
},
},
reporters: ['mocha'],
// Make Karma work with pnpm.
// See: https://github.com/pnpm/pnpm/issues/720#issuecomment-954120387
plugins: Object.keys(require('./package').devDependencies).flatMap(packageName => {
if (!packageName.startsWith('karma-')) return [];
return [require(packageName)];
}),
files: [
'dist/flat-embed.umd.js',
'test/unit/*.js',
'test/integration/lib/*.js',
'test/integration/*.js',
{
pattern: 'test/integration/fixtures/*',
watched: false,
served: true,
included: false,
},
],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['ChromeCustom'],
customLaunchers: {
ChromeCustom: {
base: 'ChromeHeadless',
// base: 'Chrome',
flags: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'],
},
},
singleRun: false,
concurrency: Infinity,
browserNoActivityTimeout: 60000,
};
config.set(configuration);
};