forked from tidepool-org/blip
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
73 lines (67 loc) · 1.67 KB
/
karma.conf.js
File metadata and controls
73 lines (67 loc) · 1.67 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
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
const webpack = require('webpack');
const _ = require('lodash');
const optional = require('optional');
const webpackConf = require('./webpack.config.js');
const mochaConf = optional('./config/mocha.opts.json') || {};
const testWebpackConf = _.assign({}, webpackConf, {
devtool: process.env.npm_lifecycle_script.indexOf('--no-single-run') === -1 ? 'inline-source-map' : false ,
plugins: [
new webpack.DefinePlugin({
__DEV__: false,
__TEST__: true,
__PROD__: false,
__I18N_ENABLED__: 'false',
}),
],
});
delete testWebpackConf.devServer;
testWebpackConf.output = {
filename: '[name]',
};
testWebpackConf.mode = 'development';
module.exports = function karmaConfig(config) {
config.set({
autoWatch: true,
browserNoActivityTimeout: 60000,
browsers: ['CustomChromeHeadless'],
captureTimeout: 60000,
client: {
mocha: mochaConf,
},
colors: true,
concurrency: Infinity,
coverageReporter: {
dir: 'coverage/',
reporters: [
{ type: 'html' },
{ type: 'text' },
],
},
customLaunchers: {
CustomChromeHeadless: {
base: 'ChromeHeadless',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222',
],
},
},
files: [
'loadtests.js',
],
frameworks: ['mocha', 'chai', 'sinon', 'intl-shim'],
logLevel: config.LOG_INFO,
preprocessors: {
'loadtests.js': ['webpack', 'sourcemap'],
},
reporters: ['mocha', 'coverage'],
singleRun: true,
webpack: testWebpackConf,
webpackMiddleware: {
noInfo: true,
stats: 'errors-only',
},
});
};