-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkarma.conf.js
68 lines (65 loc) · 1.68 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
module.exports = function (config) {
const configuration = {
browserNoActivityTimeout: 120000,
frameworks: ['mocha'],
files: [
'./src/*.spec.ts',
{pattern: './test/*.*', watched: false, included: false, served: true, nocache: false}
],
preprocessors: {
'./src/*.spec.ts': ['webpack', 'env']
},
webpack : {
mode: "production",
devtool: 'inline-source-map',
module: {
// Suppress warning from mocha: "Critical dependency: the request of a dependency is an expression"
// @see https://webpack.js.org/configuration/module/#module-contexts
exprContextCritical: false,
rules: [
{
test: /\.ts$/,
loader: "ts-loader"
},
],
},
// Suppress fatal error: Cannot resolve module 'fs'
// @relative https://github.com/pugjs/pug-loader/issues/8
// @see https://github.com/webpack/docs/wiki/Configuration#node
node: {
fs: 'empty',
},
resolve: {
extensions: ['.ts', '.js', '.json']
}
},
client: {
mocha: {
timeout: '10000'
}
},
singleRun: true,
reporters: ['mocha'],
plugins: [
'karma-chrome-launcher',
'karma-env-preprocessor',
'karma-webpack',
'karma-mocha',
'karma-mocha-reporter'
],
mime: {
'text/x-typescript': ['ts','tsx']
},
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
}
};
if(process.env.TRAVIS) {
configuration.browsers = ['Chrome_travis_ci'];
}
config.set(configuration);
}