-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathconfig.js
More file actions
127 lines (108 loc) · 3.24 KB
/
Copy pathconfig.js
File metadata and controls
127 lines (108 loc) · 3.24 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
'use strict';
if (!process.env.CHROME_BIN) {
process.env.CHROME_BIN = require('puppeteer').executablePath();
}
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
module.exports = {
// base path, that will be used to resolve files and exclude
basePath: '../src',
// load tap integration
frameworks: [
'tap', 'webpack'
],
// Run on Chrome Headless
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
// Flags required to run in ubuntu-22.04 or above (https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md)
flags: ['--no-sandbox', '--disable-setuid-sandbox']
}
},
browsers: ['ChromeHeadlessNoSandbox'],
// list of files / patterns to load in the browser
files: [
// Uncomment to run a particular UT:
// '**/listeners/__tests__/browser.spec.js',
// Run browser UTs. Commons and Node UTs run with `test-node` npm script
'*/**/__tests__/**/browser.spec.js'
],
// list of files / patterns to exclude
exclude: [
'*/**/__tests__/**/node.spec.js',
'*/**/__tests__/**/node_redis.spec.js',
'*/**/__tests__/**/*.node.spec.js',
'*/**/__tests__/**/inputValidation/*.spec.js'
],
// prepare code for the browser using webpack
preprocessors: {
'*/**/__tests__/**/*.spec.js': ['webpack'],
},
webpack: {
mode: 'production', // Use 'development' to debug with not minified bundle
devtool: false, // Use 'inline-source-map' to debug with source map
target: ['web', 'es5'], // 'web' => resolve.mainFields === ['browser', 'module', 'main']
module: {
rules: [
{
test: /\.(ts|js)$/,
// Cannot exclude 'node_modules/@splitsoftware/splitio-commons/src', in order to process TS files
exclude: /node_modules[/](?!@splitsoftware)/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true, // https://webpack.js.org/guides/build-performance/#typescript-loader
allowTsInNodeModules: true, // https://github.com/TypeStrong/ts-loader#allowtsinnodemodules
}
}
}
]
},
plugins: [
new NodePolyfillPlugin({
additionalAliases: ['process']
})
],
resolve: {
extensions: ['.ts', '.js'],
fallback: {
fs: false
}
}
},
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-webpack',
'karma-tap',
'karma-chrome-launcher'
],
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,
};