forked from xdan/jodit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
130 lines (113 loc) · 2.49 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
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
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
const path = require('path');
const webpackConfFunc = require(path.resolve(process.cwd(), './webpack.config'));
const webpackConfig = (() => {
const config = webpackConfFunc(
[],
{
mode: 'production',
isTest: true,
uglify: true,
es: 'es5'
},
process.cwd()
);
delete config.context;
// delete config.entry;
delete config.output.path;
delete config.output.filename;
delete config.output.publicPath;
// delete config.output;
return config;
})();
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'chai', "webpack"],
mime: {
'text/css': ['css'],
'text/x-typescript': ['ts', 'tsx'],
'image/jpeg': ['jpg']
},
files: [
{
pattern: './test/tests/artio.jpg',
watched: false,
included: false,
served: true
},
{
pattern: './test/test.index.html',
watched: false,
included: false,
served: true
},
'app.css',
'src/index.ts',
'node_modules/synchronous-promise/dist/synchronous-promise.js',
'test/bootstrap.js',
'config.js',
'src/**/*.test.js',
'test/tests/units/*.js',
'test/tests/acceptance/*.js',
'test/tests/acceptance/plugins/*.js'
],
proxies: {
'/tests/artio.jpg': '/base/test/tests/artio.jpg',
'/test.index.html': '/base/test/test.index.html'
},
reporters: ['progress'],
port: 2002,
hostname: '127.0.0.1',
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless', 'FirefoxHeadless', 'Firefox'],
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-width', 1440, '-height', 900, '-headless']
},
ChromeHeadless: {
base: 'Chrome',
flags: [
'--window-size=1440,900',
'--disable-gpu',
'--disable-extensions',
'--disable-translate'
]
}
},
autoWatch: true,
singleRun: true, // Karma captures browsers, runs the tests and exits
concurrency: Infinity,
preprocessors: {
'src/index.ts': ['webpack']
},
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-webpack',
'karma-mocha',
'karma-chai',
'karma-sourcemap-loader'
],
webpack: webpackConfig,
client: {
captureConsole: true,
mocha: {
bail: true
}
},
webpackMiddleware: {
quiet: true,
stats: {
chunks: false
},
noInfo: true
}
});
};