forked from dashpay/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
67 lines (63 loc) · 1.79 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
65
66
67
/* eslint-disable import/no-extraneous-dependencies */
const webpack = require('webpack');
const dotenvResult = require('dotenv-safe').config();
const webpackBaseConfig = require("./webpack.base.config");
const karmaMocha = require('karma-mocha');
const karmaMochaReporter = require('karma-mocha-reporter');
const karmaChai = require('karma-chai');
const karmaChromeLauncher = require('karma-chrome-launcher');
const karmaFirefoxLauncher = require('karma-firefox-launcher');
const karmaWebpack = require('karma-webpack');
if (dotenvResult.error) {
throw dotenvResult.error;
}
module.exports = (config) => {
config.set({
frameworks: ['mocha', 'chai', 'webpack'],
files: [
'src/**/*.spec.ts',
'src/test/karma/bootstrap.ts',
'tests/functional/sdk.js',
],
preprocessors: {
'src/**/*.spec.ts': ['webpack'],
'src/test/karma/bootstrap.ts': ['webpack'],
'tests/functional/sdk.js': ['webpack'],
},
webpack: {
...webpackBaseConfig,
mode: 'development',
plugins: [
...webpackBaseConfig.plugins,
new webpack.EnvironmentPlugin(
dotenvResult.parsed,
),
],
},
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: false,
browsers: ['ChromeHeadless', 'FirefoxHeadless'],
singleRun: false,
concurrency: Infinity,
browserNoActivityTimeout: 7 * 60 * 1000, // 30000 default
browserDisconnectTimeout: 3 * 2000, // 2000 default
pingTimeout: 3 * 5000, // 5000 default
plugins: [
karmaMocha,
karmaMochaReporter,
karmaChai,
karmaChromeLauncher,
karmaFirefoxLauncher,
karmaWebpack,
],
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless'],
},
},
});
};