-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathconfig.js
More file actions
138 lines (121 loc) · 3.17 KB
/
config.js
File metadata and controls
138 lines (121 loc) · 3.17 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
'use strict';
// Comment the next two lines if you want to run with Chrome instead of Chromium
const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();
const nodeResolve = require('@rollup/plugin-node-resolve').nodeResolve;
const commonjs = require('@rollup/plugin-commonjs');
const json = require('@rollup/plugin-json');
const string = require('rollup-plugin-string').string;
const babel = require('@rollup/plugin-babel').default;
const terser = require('rollup-plugin-terser').terser;
const nodePolyfills = require('rollup-plugin-node-polyfills');
module.exports = {
// base path, that will be used to resolve files and exclude
basePath: '../src',
// load tap integration
frameworks: [
'tap'
],
// Run on Chrome Headless
browsers: [
'ChromeHeadless'
],
// list of files / patterns to load in the browser
files: [
{ pattern: '*/__tests__/**/*.spec.js', watched: false },
{
pattern: 'engine/__tests__/engine/mocks/murmur3*.csv',
watched: false,
included: false,
served: true,
nocache: true
},
{
pattern: 'engine/__tests__/matchers/mocks/regex.txt',
watched: false,
included: false,
served: true,
nocache: true
}
],
// list of files / patterns to exclude
exclude: [
'*/__tests__/**/node.spec.js',
'*/__tests__/**/node_redis.spec.js',
'*/__tests__/**/inputValidation/*.spec.js'
],
// prepare code for the browser using rollup
preprocessors: {
'*/__tests__/**/*.spec.js': ['rollup'],
},
rollupPreprocessor: {
// `input` is handled by karma-rollup-preprocessor.
output: {
format: 'umd',
name: 'splitio',
// sourcemap: 'inline', // uncomment for debugging
},
plugins: [
nodeResolve({
browser: true,
preferBuiltins: false,
}),
commonjs(),
json(),
string({ include: '**/*.txt' }),
babel({
babelHelpers: 'runtime',
exclude: 'node_modules/**',
}),
terser(),
nodePolyfills()
]
},
// @TODO check next configs and migrate if needed:
// webpack: {
// ...
// plugins: [
// new webpack.DefinePlugin({
// 'process.env.NODE_ENV': JSON.stringify('test'),
// __DEV__: true
// })
// ],
// node: {
// fs: 'empty'
// }
// },
// webpackServer: {
// noInfo: true
// },
// web server port
port: 9876,
// make IE happy (in theory not required)
// https://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx
customHeaders: [{
match: 'html',
name: 'X-UA-Compatible',
value: 'IE=edge'
}, {
match: 'csv$',
name: 'Content-Type',
value: 'text/plain'
}],
// Which plugins to enable
plugins: [
'karma-*'
],
browserConsoleLogOptions: {
terminal: false
},
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: true,
colors: true,
/**
* @WARNING in local mode, murmur verification takes forever (chrome tested),
* so I keep this only to be used by Chrome Headless.
*/
browserDisconnectTolerance: 1,
browserNoActivityTimeout: 60 * 60 * 1000,
reportSlowerThan: 30,
};