forked from pubkey/rxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.performance.conf.js
109 lines (93 loc) · 2.63 KB
/
karma.performance.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
*/
const { startTestServers, TEST_STATIC_FILE_SERVER_PORT } = require('../test_tmp/helper/test-servers');
startTestServers();
const configuration = {
basePath: '',
frameworks: [
'mocha',
'webpack',
'detectBrowsers'
],
webpack: require('./karma.webpack.conf'),
files: [
'../test_tmp/performance.test.js'
],
// Source files that you wanna generate coverage for.
// Do not include tests or libraries (these files will be instrumented by Istanbul)
preprocessors: {
'../test_tmp/performance.test.js': ['webpack']
},
port: 9876,
colors: true,
autoWatch: false,
/**
* Serve these static files from the same port
* so we can use it to server web-workers and stuff
* and access them with same-origin-restricted code.
*/
proxies: {
'/files': 'http://localhost:' + TEST_STATIC_FILE_SERVER_PORT + '/files'
},
browserNoActivityTimeout: 1000 * 60 * 3,
detectBrowsers: {
enabled: true,
usePhantomJS: false,
postDetection: function () {
/**
* We run the performance tests only in chrome
* because it has the same V8 JavaScript engine
* as we have in Node.js
*/
return ['Chrome'];
}
},
// Karma plugins loaded
plugins: [
'karma-mocha',
'karma-webpack',
'karma-chrome-launcher',
'karma-safari-launcher',
'karma-firefox-launcher',
'karma-ie-launcher',
'karma-opera-launcher',
'karma-detect-browsers',
'karma-spec-reporter'
],
client: {
mocha: {
bail: true,
timeout: 12000
},
/**
* Pass all env variables here,
* so that they can be used in the browsers JavaScript process.
* @link https://stackoverflow.com/a/38879184
*/
env: process.env
},
browserDisconnectTimeout: 12000,
processKillTimeout: 12000,
singleRun: true,
/**
* Use this reported to fully log all test names
* which makes it easier to debug.
* @link https://github.com/tmcgee123/karma-spec-reporter
*/
reporters: ['spec']
};
if (process.env.CI) {
console.log('# Use CI settings.');
/**
* overwrite reporters-default
* So no big list will be shown at log
*/
// configuration.reporters = [];
// how many browser should be started simultaneously
configuration.concurrency = 1;
}
module.exports = function (config) {
// console.log('karma config:');
// console.dir(configuration);
config.set(configuration);
};